现有table:t1,t2
表结构:
t1(id,A,B,C,D,E)
t2(id,A,B,C)
表数据:
t1:
1,a1,b1,c1,d1,e1
2,a2,b2,c2,d2,e2
3,a3,b3,c3,d3,e3t2:
1,aa1,bb1,cc1
2,aa2,bb2,cc2
要求结果:
1, a1, b1, c1
1,aa1,bb1,cc1即选出t1和t2中id为1的列id,A,B,C
表结构:
t1(id,A,B,C,D,E)
t2(id,A,B,C)
表数据:
t1:
1,a1,b1,c1,d1,e1
2,a2,b2,c2,d2,e2
3,a3,b3,c3,d3,e3t2:
1,aa1,bb1,cc1
2,aa2,bb2,cc2
要求结果:
1, a1, b1, c1
1,aa1,bb1,cc1即选出t1和t2中id为1的列id,A,B,C
union
select id,A,B,C from t2 where id = 1
select id, A,B,C from t1 where id=1
union all
select id, A,B,C from t2 where id=1?
select id, A,B,C from t1 where id=1
union all
select id, A,B,C from t2 where id=1正解