Query the N records in the database, then sort this N records

xiaoxiao2021-03-06  80

See this topic, some people will write this one, select top 10 * from tablename ORDER BY CREATETIME This statement is meaningful and the theme reverse correct answer 1: SELECT TOP 10 * from Tablename WHERE ID in (SELECT TOP 10 ID from Tablename Order By ID) ORDER BY CREATETIME This statement can find the top 10 records in the table, then sorted by CreateTime time is a primary key.

Answer 2 No primary key can also be select * from (select top 10 * from titles) mmorder by Pubdate Desc

转载请注明原文地址:https://www.9cbs.com/read-93621.html

New Post(0)