-- 大概这个样子
select * from a
union all
select from b where not exists(select * from a where a.id = b.id and a.no= b.no)
#2
select * from A where not exists(select 1 from B where A.od=B.useroid)
#3
[SQL]select * from tb_order a
union all
select * from tb_usermagic b where not exists(select * from tb_order a where a.oid = b.useOid and a.oid.no= b.useOid.no)
[Err] 1054 - Unknown column 'a.oid.no' in 'where clause'
#4
上面那个写错了
[SQL]select * from tb_order a
union all
select * from tb_usermagic b where not exists(select * from tb_order a where a.oid = b.useOid and a.no= b.no)
[Err] 1054 - Unknown column 'a.no' in 'where clause'
#5
SELECT * FROM A AS T WHERE OID IN (
SELECT Oid FROM A WHERE NOT EXISTS(SELECT 1 FROM B WHERE UseOid=A.Oid) GROUP BY Oid HAVING COUNT(*)=1)
#6
你把列名,要换成你的自己的,我只是写个例子;
PS: 楼主有点懒啊。
#1
-- 大概这个样子
select * from a
union all
select from b where not exists(select * from a where a.id = b.id and a.no= b.no)
#2
select * from A where not exists(select 1 from B where A.od=B.useroid)
#3
-- 大概这个样子
select * from a
union all
select from b where not exists(select * from a where a.id = b.id and a.no= b.no)
[SQL]select * from tb_order a
union all
select * from tb_usermagic b where not exists(select * from tb_order a where a.oid = b.useOid and a.oid.no= b.useOid.no)
[Err] 1054 - Unknown column 'a.oid.no' in 'where clause'
#4
-- 大概这个样子
select * from a
union all
select from b where not exists(select * from a where a.id = b.id and a.no= b.no)
上面那个写错了
[SQL]select * from tb_order a
union all
select * from tb_usermagic b where not exists(select * from tb_order a where a.oid = b.useOid and a.no= b.no)
[Err] 1054 - Unknown column 'a.no' in 'where clause'
#5
SELECT * FROM A AS T WHERE OID IN (
SELECT Oid FROM A WHERE NOT EXISTS(SELECT 1 FROM B WHERE UseOid=A.Oid) GROUP BY Oid HAVING COUNT(*)=1)
#6
-- 大概这个样子
select * from a
union all
select from b where not exists(select * from a where a.id = b.id and a.no= b.no)
上面那个写错了
[SQL]select * from tb_order a
union all
select * from tb_usermagic b where not exists(select * from tb_order a where a.oid = b.useOid and a.no= b.no)
[Err] 1054 - Unknown column 'a.no' in 'where clause'