求一个SQL查询语句 在线等答案

cdh520fy cdh520fy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
select a.line_id from
(select line_id from station where station_name = '商城') a,
(select line_id from station where station_name = '第二中学') b
where a.line_id = b.line_id

我从A表中查得a.line_id
然后想要a.line_id当做B表的where条件
也就是 select * where id = a.line_id

请问怎么把这两个查询语句合并 ?
我是在c#中使用 需要查得数据放到DataGridView里
...全文
评论 9
收藏 已收藏
分享
返回顶部
cdh520fy
MS-SQL Server 34,877 成员 254,635 内容