如何将多个表的查询结果连成一个表 这个SQL语句怎么写 表的结构是一样的 例如:key=request.form("key") set rs=server.createobject("adodb.recordset") sql = "select * from toutiao where title like '%"&key& "%' or content like '%"&key& "%' " sql = "select * from xinxi where title like '%"&key& "%' or content like '%"&key& "%' " 。就是将上多个SQL变成一句
select * from (select name,content from A union all select name,content from B union all select name,content from C) where name like '%中国%' or content like '%中国%'
select A.name, A.content, B.name, B.content, C.name, C.content from A,B,C where name like '%中国%' or content like '%中国%'
select * from a where name like '%中国%' or content like '%中国%' union all select * from b where name like '%中国%' or content like '%中国%' union all select * from c where name like '%中国%' or content like '%中国%'
例如:key=request.form("key")
set rs=server.createobject("adodb.recordset")
sql = "select * from toutiao where title like '%"&key& "%' or content like '%"&key& "%' "
sql = "select * from xinxi where title like '%"&key& "%' or content like '%"&key& "%' "
。就是将上多个SQL变成一句
select * from a where name like '%中国%' or content like '%中国%'
union all
select * from b where name like '%中国%' or content like '%中国%'
union all
select * from c where name like '%中国%' or content like '%中国%'