您的位置:首页 > 博客中心 > 数据库 >

mysql 变量is null 和 not exists区别

时间:2022-03-13 23:41

问题:

使用游标遍历时,发现使用

select var into tmp where var=?

然后判断if tmp is null时,不能走完所有的遍历。经debug发现,

当var为空时,则跳出游标的遍历。

 

解决方式:

使用if not exists(select var into tmp where var=?)时,则ok。

 

暂且不知道原因,记录下来留待后续探究。

 Apache Kafka is publish-subscribe messaging rethought as a distributed commit log

http://kafka.apache.org/

The Apache Mahout™ project‘s goal is to build a scalable machine learning library.

https://mahout.apache.org/

热门排行

今日推荐

热门手游