U
uedit
Unregistered / Unconfirmed
GUEST, unregistred user!
SELECT A, B, C
FROM DATA
WHERE IDXPARTNO = 753
AND IDXMACHINENO = 405
AND IDXPROCM = 981
AND ROWNUM <= 60
ORDER BY B DESC, C DESC
SELECT *
FROM (
SELECT A, B, C
FROM DATA
WHERE IDXPARTNO = 753
AND IDXMACHINENO = 405
AND IDXPROCM = 981
ORDER BY B DESC, C DESC
) A
WHERE ROWNUM <= 60
問題是這樣的, 上面有兩個語句, 是ORACLE的, 意思是要先排序再取前面60條記錄, 請大家比較一下兩個語句的差別,
我取到的結果是不一樣的, 請大家指教, 謝謝.
FROM DATA
WHERE IDXPARTNO = 753
AND IDXMACHINENO = 405
AND IDXPROCM = 981
AND ROWNUM <= 60
ORDER BY B DESC, C DESC
SELECT *
FROM (
SELECT A, B, C
FROM DATA
WHERE IDXPARTNO = 753
AND IDXMACHINENO = 405
AND IDXPROCM = 981
ORDER BY B DESC, C DESC
) A
WHERE ROWNUM <= 60
問題是這樣的, 上面有兩個語句, 是ORACLE的, 意思是要先排序再取前面60條記錄, 請大家比較一下兩個語句的差別,
我取到的結果是不一樣的, 請大家指教, 謝謝.