我要查询表中年龄最大的10条记录,SQL应该怎么写?(在线等待)

PI_2002 2002-08-14 05:14:24
我要查询表中年龄最大的10条记录,SQL应该怎么写?
...全文
674 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
AWP365 2002-08-14
  • 打赏
  • 举报
回复
select top 10 * from table order by nl(年龄) DESC
是对的
caiyunxia 2002-08-14
  • 打赏
  • 举报
回复
j9988(j9988) 怎么喜欢用子查询,好象会影响性能
caiyunxia 2002-08-14
  • 打赏
  • 举报
回复
select top 10 * from table order by nl(年龄) DESC
错了DESC 在后面
j9988 2002-08-14
  • 打赏
  • 举报
回复
select top 10 * from (select * from tablename order by nl desc) a
caiyunxia 2002-08-14
  • 打赏
  • 举报
回复
select top 10 * from table order by DESC nl(年龄)

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧