从3个表中选出name字段成为新表的name字段的值 那你应该放到字段列表中啊,怎么放到where中了? select tbl1.name+tbl2.name+tbl3.name as newname from newtable where ....
select tbl1.name+tbl2.name+tbl3.name as newname from newtable,tbl1,tbl2,tbl3 where ...
select name from tbl1 union all select name from tbl2 union all select name from tbl3
select tbl1.name+tbl2.name+tbl3.name as myname into #a from tbl1,tbl2,tbl3 where ……select * from newtable where newtable.name= (select a.myname from #a a)
那你应该放到字段列表中啊,怎么放到where中了?
select tbl1.name+tbl2.name+tbl3.name as newname
from newtable
where ....
from newtable,tbl1,tbl2,tbl3
where ...
union all
select name from tbl2
union all
select name from tbl3
into #a
from tbl1,tbl2,tbl3
where ……select * from newtable
where newtable.name= (select a.myname from #a a)