1:编号为003的员工信息优先显示:
select * from table_a where 员工编号='003'
union
select * from table_b where 员工标号!='003'
select A.jh from zscsg_jdbc A where A.jh='翻131-49'
union
select B.jh from zscsg_jd B where B.jh != '翻131-49'
2:求交集
intersect函数:Intersect(Set1 , Set2 [ , ALL ] )
select A.jh from zscsg_jdbc A
intersect
select B.jh from zscsg_jd B
3:查询表A有,但是表B没有的数据(A的id:1,2,3,4,5,6,7||B的ID:1,2,3,4,5)
select * from student A
left join student_1 B on A.ID=B.ID
where B.ID is null
select * from table_a where 员工编号='003'
union
select * from table_b where 员工标号!='003'
select A.jh from zscsg_jdbc A where A.jh='翻131-49'
union
select B.jh from zscsg_jd B where B.jh != '翻131-49'
2:求交集
intersect函数:Intersect(Set1 , Set2 [ , ALL ] )
select A.jh from zscsg_jdbc A
intersect
select B.jh from zscsg_jd B
3:查询表A有,但是表B没有的数据(A的id:1,2,3,4,5,6,7||B的ID:1,2,3,4,5)
select * from student A
left join student_1 B on A.ID=B.ID
where B.ID is null