想从数据库里抽取code值为1,且时间按最近往远排,排完后再取前2条数据
我写的sql是:
select * from 表 where code=1 and rownum<=2 order by date desc
写出来和预想的不一样,请问是哪里出错了
SELECT
*
FROM
(
tabname
WHERE
CODE = 1
ORDER BY
date DESC
) kk
rownum <= 2
————————————————————————————