sql如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 01:42:17
sql如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe

sql如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe
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如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe
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'

select distinct id from a where id='456' and id = '123'

此结果无交集·

我想通过查询与当前新闻具有关键字交集不为空的新闻来实现,可又不知道这.,至于这个怎么组合这个sql,这个我想你应该知道的吧,不知道我有没有理解

sql如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe 这样的数据库填空题你会么?1.批处理是由一条或多条()组成的语句集,从应用程序一次性地发送到SQL Server 执行.2.在 Transact-SQL 语句编写的程序中,可以使用()将多条SQL语句分隔,两条GO语句 清空某表的全部数据的SQL语句是不是这样写?SQL语句:truncate table phpcms_ads_stat sql语句 decimal(18, 数据库中两个数相除怎么写SQL语句 sql语句中DISTINCT是什么意思 integer是什么意思?SQL语句中 drop table if exists address_book;这句SQL语句是什么意思我备份的SQL语句中有这么一行, select ename from emp where ename like'%A___'; 这条SQL语句中'%A___'是什么意思? 求SQL,有两个表A,B.其中A有a1,a2两字段,B有b1,b2.A的a2的值应和B的条数相等,条件是A.a1=B.b1.想统计数据库中,不满足上述条件,即A的a2值和B的条数不相等的数据一共哪些条,都是什么?急求该SQL语句 SQL语句中的(;)分号是什么意思? SQL中begin end 怎么用着条语句? SQL 语句 SELECT * FROM {{table}} WHERE `fleet_end_time` sql语句中什么时候用commit? sql 语句中commit的作用 SQL的SELECT语句有哪几部分构成?,作用分别是什么?,如何利用它们表达查询要求? sql语句如何写?有一个表table 里面有A,B,C,D四个字段假设表里面有10条数据,字段A为自增的id,B为标题,C为短标题,D为空字段.其中前5条数据(条件已知)标题为空,短标题有数据,后5条短标题为空, SQL里面的排序语句desc和ASC有什么区别