1) UNION ALL
select之间的columns必须相同,否则会报错;
2) SubQuery
a. 在from之后的子查询
select id from (select id,zipcode from t1) t2;
b. 在where之后的子查询
select * from t1 where t1.id IN (select id from t2);
1) UNION ALL
select之间的columns必须相同,否则会报错;
2) SubQuery
a. 在from之后的子查询
select id from (select id,zipcode from t1) t2;
b. 在where之后的子查询
select * from t1 where t1.id IN (select id from t2);