select id,name,type from A union all select id,name,type from B union all select id,name,type from C union all where ??? ---------------------------------------------------- 1,张三,会员 2,李四,钻石 7,王五,普通 3,张三,会员 5,张三,会员 --------------------------------------- 查询时 “会员” 的用户列 Where 后面怎么写。。。 type='会员' 不行 成功后 即结贴。。。。。。。。。。。。。 A.type = '' or B.type='' or C.type='' 先结帖再试吧 都要写吗? 我又多张表 SQL code: select id,name,type from A where [TYPE]='会员' union all select id,name,type from B where [TYPE]='会员' union all select id,name,type from C where [TYPE]='会员'
select * from( select id,name,type from A union all select id,name,type from B union all select id,name,type from C) t where type='会员' T是