How to select top N from a table

后端 未结 9 833
醉酒成梦
醉酒成梦 2020-12-11 21:18

I have to select the top 25 records from a table according to the column Num.

There are two issues. First, the table is not sorted by Num.

9条回答
  •  遥遥无期
    2020-12-11 21:31

    Oracle:

    Select *
    FROM Table
    WHERE rownum <= 25
    

    MSSQL:

    SELECT TOP 25 * 
    from Table
    

    Mysql:

    SELECT * FROM table
    LIMIT 25
    

提交回复
热议问题