问题是这样的:
有两张表:table 1 的结构:
id1 id2 1 1
1 2
3 4
6 9table 2的结构:
id1 id2
1 1
1 2
3 4
7 11
就是希望实现 oracle的 minus的效果:select * from table1
minus
select * from table2;
id1 id2
6 9mysql 要得到这种结果要怎么写才可以呢?
有两张表:table 1 的结构:
id1 id2 1 1
1 2
3 4
6 9table 2的结构:
id1 id2
1 1
1 2
3 4
7 11
就是希望实现 oracle的 minus的效果:select * from table1
minus
select * from table2;
id1 id2
6 9mysql 要得到这种结果要怎么写才可以呢?
解决方案 »
- 访问网站时"偶尔"出现返回 Can't connect to MySQL server on '127.0.0.1' (10061)。
- 如何批量修改数据库中所有表的指定查找内容?
- MYSQL学习资源
- mySql数据库如何重命名?
- select语句中sum的问题
- mysql如何实现远程启动服务,能否实现?如何实现?
- 诚恳求助:客户端如何SSL连接到服务器上?
- 我要将MYSQL的权限设置为其他计算机可用,该如何设置?
- mysql中如何按 年 月 日 这三个参数进行数据查询
- 有2个表 [color=#FF0000]lasttime_table[/color](登录时间表) [color=#FF00FF]regtime_table[/
- 为什么下面这个存储过程在mysql中运行后,会出现如下错误提示?怎样解决?
- mysql 存储过程游标的问题
where not exists (select 1 from table2 t2 where t1.id1 = t2.id1 and t1.id2 = t2.id2)如果id1本身就都是主键的话,可以
select * from table1 t1
where not exists (select 1 from table2 t2 where t1.id1 = t2.id1)
from tb1 A
where not exists (select 1 from tb2 id1=A.id1 and id2=A.id2)