查询数据库表中前10条记录怎么写呢?

来源:百度知道 编辑:UC知道 时间:2024/05/24 21:29:43
查询数据库表中前10条记录怎么写呢?

查询前十条记录(顺数)select top 10 * form 表 where ..." '也可以不要后面的where子句
查询后十条记录(倒数)select top 10 * form 表 where ... order by id desc"'注:ID是数据库自动编号

select top 10 * from 表名