1.oracle 字符串时间比较(BIND_DATE在数据库中是字符类型,为 2014-05-12 09:46:06 格式)
SELECT * from tableN a WHERE TO_DATE(a.BIND_DATE,'YYYY-MM-DD HH24:MI:SS')>TO_DATE('2014-05-11','YYYY-MM-DD')
2.oracle取前1000条数据:rowid 是oracle标识了行的存储的具体位置,rownum是oracle为查询结果集增加的序号。
SELECT
*
FROM
(
SELECT
tmp.*, ROWNUM AS tmpROWNUM
FROM
(
SELECT
T .*, ROWID AS tROWID
FROM
tableN T
) tmp
WHERE
ROWNUM <= 1000
) tmpTmp
WHERE
tmpROWNUM > 0
ORDER BY
tmpTmp.date DESC