Can you tell how to Sort in Oracle DB?
-
using RowNum? who can tell me the RowId in last Column? what's effect?
-
using RowNum? who can tell me the RowId in last Column? what's effect?
openboy2010 wrote:
using RowNum?
SELECT ROWNUM, T.*
FROM TEST_TABLE T
ORDER BY ROWNUMopenboy2010 wrote:
who can tell me the RowId in last Column?
SELECT C.ROWYOURBOAT
FROM
(SELECT COUNT(*) AS ROWCOUNT
FROM TEST_TABLE T
) A,
(SELECT ROWNUM AS ROWCOUNT, ROWID AS ROWYOURBOAT
FROM TEST_TABLE T
ORDER BY ROWNUM
) C
WHERE A.ROWCOUNT = C.ROWCOUNTopenboy2010 wrote:
what's effect?
I don't know what your are asking here...
:)
modified on Thursday, December 30, 2010 11:03 AM
-
openboy2010 wrote:
using RowNum?
SELECT ROWNUM, T.*
FROM TEST_TABLE T
ORDER BY ROWNUMopenboy2010 wrote:
who can tell me the RowId in last Column?
SELECT C.ROWYOURBOAT
FROM
(SELECT COUNT(*) AS ROWCOUNT
FROM TEST_TABLE T
) A,
(SELECT ROWNUM AS ROWCOUNT, ROWID AS ROWYOURBOAT
FROM TEST_TABLE T
ORDER BY ROWNUM
) C
WHERE A.ROWCOUNT = C.ROWCOUNTopenboy2010 wrote:
what's effect?
I don't know what your are asking here...
:)
modified on Thursday, December 30, 2010 11:03 AM
the last sentence means what's the RowId's effect?
-
the last sentence means what's the RowId's effect?
-
if we sort a table ,can we using the RowID sort ? I'm a Chinese Student,My Written English is not very well.
-
if we sort a table ,can we using the RowID sort ? I'm a Chinese Student,My Written English is not very well.
openboy2010 wrote:
My Written English is not very well.
That's ok it is good enough, I just wanted clarification so I can answer your homework question appropriately. RowID is a column generated by oracle to map to that particular row. If you sort by RowID instead of RowNum, the results may not be the same. RowNum is a column generated by Oracle from the RESULTS of the Select Query.
:)
-
openboy2010 wrote:
My Written English is not very well.
That's ok it is good enough, I just wanted clarification so I can answer your homework question appropriately. RowID is a column generated by oracle to map to that particular row. If you sort by RowID instead of RowNum, the results may not be the same. RowNum is a column generated by Oracle from the RESULTS of the Select Query.
:)
thank you