intersect 相交,except 相减,union 合并 ,union all 合并全部区别

select * from PV_ENCOUNTER where CODE_PV like '200630001%'
intersect --相交的
select * from PV_ENCOUNTER where CODE_PV like '2006300011'

select * from PV_ENCOUNTER where CODE_PV like '200630001%'
except--不相交的
select * from PV_ENCOUNTER where CODE_PV like '2006300011'

select * from PV_ENCOUNTER where CODE_PV like '200630001%'
union--相同的会去重
select * from PV_ENCOUNTER where CODE_PV like '2006300011'

select * from PV_ENCOUNTER where CODE_PV like '200630001%'
union all--相同的不会去重
select * from PV_ENCOUNTER where CODE_PV like '2006300011'

posted @ 2020-11-04 08:47  罗曼蒂克'  阅读(239)  评论(0)    收藏  举报