Question

I have a table for comments history. I need to select only ten data after rearranging the data (order by clause) based on date (newer to older). May I know how to achieve that? Is that can be done using rownum?

Was it helpful?

Solution

SELECT  *
FROM    (
        SELECT  *
        FROM    comment
        ORDER BY
                comment_date DESC
        )
WHERE   rownum <= 10
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top