select distinct id
from table t
where rownum < 10
order by t.id desc;
上述语句的过滤条件执行顺序 先where --->order by --->distinct
如果有group by的话 group by 在order by前面的
select distinct id
from table t
where rownum < 10
order by t.id desc;
上述语句的过滤条件执行顺序 先where --->order by --->distinct
如果有group by的话 group by 在order by前面的