rownum does not work with order by, it is the internal row number try sequence. but that is not standard sql. and if it is not standard sql, there are many ways to do this.
【在 j***y 的大作中提到】 : oracle: : select rownum, a from table XXX order by a
b*e
7 楼
what's the point of questions like these??? off the top of my head i know of no standard (or non-standard) way of doing this.. but even if there is one .. what does one gain by knowing it??? in a real world scenario there can be 1000 ways of getting this result..
【在 a****o 的大作中提到】 : rownum does not work with order by, it is the internal row number : try sequence. : but that is not standard sql. : and if it is not standard sql, there are many ways to do this.
x*u
8 楼
SELECT COUNT(A.a) b, A.a a FROM XXX A, XXX B WHERE A.a >= B.a GROUP BY A.a ORDER BY b;