易截截图软件、单文件、免安装、纯绿色、仅160KB

sql语句多表多字段查询 - MS-SQL Server / 基础类

我有多个表A B C 结构是一样的,都有2个字段name和content,我要搜索所以表所有字段中包含“中国”的内容 这个SQL语句怎么写 

如何将多个表的查询结果连成一个表 这个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 '%中国%'

SQL code:

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 '%中国%'



顶一个!!


相关问答:

如何用c#,sql2000 开发c/s下的工作流?

本人c#新手 可是要求要用c# ,sql2000开发c/s的工作流,一头雾水,请大家帮忙帮忙,给点思路,说的约具体越好,我也好往那个方面去学习
http://www.hxzi.com/view/61402.html
B/S版的,基本思想应该差不多的。。 ......

sql 问题

DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)

string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

dbf表导入到sql server2000表问题

请问:
1,如何将一张dbf表导入到sql server2000中的一张表。使用DTS该怎样实现?
2,使用网上代码:
Insert Into Tb_cj Select * from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro D ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号