存储过程

CREATE  PROCEDURE  getUid (IN phone CHAR(11), OUT uid INT )
    READS SQL DATA
BEGIN
    select u.id  from mami_auth.tb_user u where u.cellphone like CONCAT('%',phone);
END;

# drop PROCEDURE getUid;

call getUid('6722',@uid);

函数

CREATE  FUNCTION  fn_get_uid (phone CHAR(11) )
    RETURNS INT
BEGIN
    RETURN  (select u.id  from mami_auth.tb_user u where u.cellphone like CONCAT('%',phone) );
END;

# drop FUNCTION fn_get_uid;

select fn_get_uid('6722') as uid;

相关文章:

  • 2022-12-23
  • 2022-02-24
  • 2021-07-21
  • 2021-12-04
  • 2021-09-18
  • 2021-09-05
  • 2022-12-23
猜你喜欢
  • 2021-05-05
  • 2021-10-26
  • 2021-11-08
  • 2021-09-04
  • 2022-12-23
相关资源
相似解决方案