sql如何取交集有这样两条sql语句select distinct id from a where id='123'se
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/05 20:28:58
sql如何取交集
有这样两条sql语句
select distinct id from a where id='123'
select distinct id from a where id='456'
我希望能把他们取得他们记录的交集,sql语句该如何写?
错了 应该是这样的
select distinct temid from a where id='123'
select distinct temid from a where id='456
有这样两条sql语句
select distinct id from a where id='123'
select distinct id from a where id='456'
我希望能把他们取得他们记录的交集,sql语句该如何写?
错了 应该是这样的
select distinct temid from a where id='123'
select distinct temid from a where id='456
select distinct id from a where id='123' and id in (select distinct id from a where id='456')
不过偶实在没看出select distinct id from a where id='123'这种语句有什么用处. 就你写的来说这二者不可能有什么交集.
如果你的意思是指并集,就应该用select distinct id from a where id='456' or id = '123'
再问: 这样可以 我还想问一下 如果这个id是个参数 有多个这样的id 不是2个 该怎么写呢
不过偶实在没看出select distinct id from a where id='123'这种语句有什么用处. 就你写的来说这二者不可能有什么交集.
如果你的意思是指并集,就应该用select distinct id from a where id='456' or id = '123'
再问: 这样可以 我还想问一下 如果这个id是个参数 有多个这样的id 不是2个 该怎么写呢
sql如何取交集有这样两条sql语句select distinct id from a where id='123'se
sql 中 select * from A left join B on A.id=B.id where A.id=?如
请教sql语句,像select …from wsdy_zb t where t.id =:id order by no
select id from (select * from tree)这个sql语句有什么错吗
请问sql="select * from 招聘信息 order by id
sql="select * from "&data&" where id="&myid&"" 在数据库中没有data 这
sql语句中参数乘法select top 4 *from UserInfowhere ID not in(select
sql = "Select * from product_series order by index desc,id a
select distinct A.* from A,B where A.id = B.g_id and A.fwzid
在SQL语句中USE pubs SELECT DISTINCT title FROM title WHERE price
SQL 语句 "SELECT * FROM {{table}} WHERE `fleet_end_time`
sql函数,select count(A.abc) as sum from A left join B on A.id=