100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > mysql存储过程中使用select count(*) into 变量名 from +表+ where条件的用法

mysql存储过程中使用select count(*) into 变量名 from +表+ where条件的用法

时间:2019-03-08 02:36:40

相关推荐

mysql存储过程中使用select count(*) into 变量名 from +表+ where条件的用法

select count(*) into v_count from dual where userid=2;

此语句的意思就是根据where条件查询dual表,得到的行数存入变量v_count中(给变量赋值)

只能在存储过程中编写这样的语句?如果在mysql的sql语句中编写不知道会不会报错呢

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。