
字段是 id name number
12 ‘name’ 123
21 ‘name1’ 321
表2 是
字段 id arg istrue
12 2 1
32 2 0
通过ID = 12
同时对这两个表查找?
select * from 表1 where id = 12
union all
select * from 表2 where id = 12
如果arg是启扒备数悄毁值型的则要用cast或convert转换此握成字符
select * from t1 as a inner join t2 as b on a.id=b.id
where a.id=12
select * from
(select * from 表友轿1
union
select * from 表凳告掘枣核2)
where id = 12
select * from 表1,表2 where 表1.id = 表2.id and 表1.id = 12;