康老师

sql语句中的条件语句用什么来表

2017-03-28 分类:百科

TIPS:本文共有 212 个字,阅读大概需要 1 分钟。

if exists(select 0 from table_2)    select * from table_1 where  number in(select number from table_2)else    select * from table_1 使用Exists判断是否有数据速度最快,效率最高,其他的使用Count()方式,都要遍历table_2表,而Exists判断方式只要扫描到一行即会认为表达式为真

小编精心整理的这篇内容:sql语句中的条件语句用什么来表,如果你看到此处请一定要收藏哦!

阅读剩余内容
网友评论
相关阅读
小编推荐