目录
============
1.没有distinct时,正常
select a,b from AAA where d='XXX' order by c
2.结合使用时报错
select distinct a,b from AAA where d='XXX' order by c
3.问题解决
select distinct a,b, c from AAA where d='XXX' order by c
4.问题原因
distinct执行时会对查询的记录进行去重,产生一张虚拟的临时表;
临时表中,没有c这个项目
order by的排序对象结果集是,那张 虚拟的临时表
===