查看两表中不同的记录:select a.* from a left join b on a.col1=b.col1 where b.col1 is null
如果还想再加上仅B表中有的: select a.* from a left join b on a.col1=b.col1 where b.col1 is null union all select b.* from a right join b on a.col1=b.col1 where a.col1 is null
如果还想再加上仅B表中有的: select a.* from a left join b on a.col1=b.col1 where b.col1 is null union all select b.* from a right join b on a.col1=b.col1 where a.col1 is null _______________________________________ 这个很好,这个词句我会,只是没有想到where b.col1 is null。 是啊,都是些ORACLE的文。 —————————————————————— UNION查出来的是相同的记录(合并)加不同的记录,我是想如何能把相同的记录过滤掉,只显示不同的记录。(前提是不建临时表,只用SQL语句查) 感谢各位的支持。
from a left join b on a.col1=b.col1
where b.col1 is null
select a.*
from a left join b on a.col1=b.col1
where b.col1 is null
union all
select b.*
from a right join b on a.col1=b.col1
where a.col1 is null
如果还想再加上仅B表中有的:
select a.*
from a left join b on a.col1=b.col1
where b.col1 is null
union all
select b.*
from a right join b on a.col1=b.col1
where a.col1 is null _______________________________________
这个很好,这个词句我会,只是没有想到where b.col1 is null。
是啊,都是些ORACLE的文。
——————————————————————
UNION查出来的是相同的记录(合并)加不同的记录,我是想如何能把相同的记录过滤掉,只显示不同的记录。(前提是不建临时表,只用SQL语句查)
感谢各位的支持。