日期:2014-05-16  浏览次数:22599 次

count(1),count(*),order by 1,2,3,4 区别

有图有真相 上图

1 制造NULL数据;

2 直接用列名来COUNT下看结果

3 用 1 2 3 4 5 * 来COUNT 下看下结果 发现都是一样的数据 都是等于全部函数.

4 ORDER BY 1 确实使用第一列来排序

5 ORDER BY 2   看看 结果正确

结果:

count(1)=count(2)=count(3)=count(*);

count(provcode)<>count(areacode)<>count(statedate)<>count(*);

order by 1<>order by 2<> oreder by 3;

order by 1=orderby  provcode

附加结果: