select 1 from table

1  select 1 from 中的1是一常量,查到的所有行的值都是它, --增加临时列--,每行的列值是写在select后的数 (常用作判断条件);

2  查看记录条数用select sum(a) from table; 不管count(a)的a值如何变化,得出的值总是table表的行数

    等价于select sum(*) from table; 

3  select sum(1) from table   计算临时列的和

原文地址:https://www.cnblogs.com/xuedong/p/5291154.html