社区
MS-SQL Server
帖子详情
为什么子查询里面使用 order by 会出错的?
lazybone
2004-05-08 11:38:59
为什么子查询里面使用 order by 会出错的?
select * from table2
where age in (select age from table2 where age>44 order by age)order by age
...全文
143
6
打赏
收藏
为什么子查询里面使用 order by 会出错的?
为什么子查询里面使用 order by 会出错的? select * from table2 where age in (select age from table2 where age>44 order by age)order by age
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
internetcsdn
2004-05-08
打赏
举报
回复
select * from table2
where age in
(select distinct age from table2 where age>44 ) order by age
这样可以啊
lazybone
2004-05-08
打赏
举报
回复
同样在子查询里面不能用 distinct 是不是这样原因?
internetcsdn
2004-05-08
打赏
举报
回复
错误提示里好明显地提到啦,
如果你一定要用的话试下.
select * from table2
where age in
(select top 1000 age from table2 where age>44 order by age)order by age
lazybone
2004-05-08
打赏
举报
回复
但也不应该错啊. 最多是做事画蛇添足罢了
internetcsdn
2004-05-08
打赏
举报
回复
order by 在你的子查询里没有什么意义
internetcsdn
2004-05-08
打赏
举报
回复
select * from table2
where age in
(select age from table2 where age>44 )order by age
在子查询里用不着用到order by 啊
Mysql数据库进阶/引擎/分组/连接/
子查询
/事务/Django框架的model
本课程是理论和实战相结合的课程。 主要讲解以下知识点:...by分组/having及多表查询 通过案例来讲解join连接 讲解
子查询
的实际应用 通过多个案例来讲解如何
使用
join和
子查询
讲解django框架的models中如何应用多表查询
sqlserver
Order
By在
子查询
嵌套中
出错
的解决方法
sql server 中关于
Order
By 在
子查询
嵌套中的
出错
的解决方法! 一直以来,总是被困于一旦sql 语句,
子查询
中有
order
by 就
出错
的烦恼,没想到用这一招就解决了,无意中发现,确成了解决方法,。 解决方法是:只要在2...
sql server 中关于
Order
By 在
子查询
嵌套中的
出错
的解决方法!
一直以来,总是被困于一旦sql 语句,
子查询
中有
order
by 就
出错
的烦恼,没想到用这一招就解决了,无意中发现,确成了解决方法,。 解决方法是:只要在2个select 后加上一个top 1000000,就行了。呵呵 'select top ...
mysql8.0
子查询
的
order
by无效
最近一个需求:查询最近视频的历史观看记录. 课程表(t_course)如下: 12 idnameprice 视频表(t_video)如下: 1 idvideo_urlcourse_id 记录表(t_record)如下:用户在观看一个视频后
会
将update_ti...
ORACLE:
子查询
(where写在
子查询
中)注:单行
子查询
返回有多行结果时,
会
出错
。
使用
IN 和 NOT IN。在SELECT中
使用
子查询
。IN 等于列表中的某一个值。ANY 与列表的任意值比较。ALL 与列表所有值比较。:等价于not in。在FROM中
使用
...
MS-SQL Server
34,590
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章