1.union:得到两个结果集的并集(不含重复值)example:select name,nameid from table where classid = 10 union select name,nameid form table where classid = 20; 相当于 select name,nameid from table where classid =10 or classid = 20;
2.minus:求一个结果集减去后一个结果集的差值(不含重复值) example: select name,nameid from table where classid in (10,20) minus selcet name,nameid form table where age < 20; 相当于 select name,nameid from table where classid in (10,20) and age >=20;
3.两个结果集的结果字段名称必须一样,否则会报错;