Select 1 from table and Select any col from table
时间:
2015-08-21 15:12:27
阅读:
171
评论:
收藏:
0
[点我收藏+]
- select 1 from table ;select any col from table (any col is any row of purpose collection) ;select * from table 作用上来说是没有差别的,都是查看是否有数据记录,一般是做条件用的。Select 1 from table中的1 是一个常量,查到所有的值都是它,但是从效率上来说 1> anycol > *,因为不用查字典表。
- 查看记录条数时可以用 select count(1)from table 等价于select count(*) from mytable;
Select 1 from table and Select any col from table
原文:http://www.cnblogs.com/zhanggongchang/p/4747807.html