UNION ALL多表搜索查询
来源:互联网 发布:千里眼定位软件 编辑:程序博客网 时间:2024/05/16 09:06
默认查询出来的字段只有第1个表的字段名,所以无法分辨,这时要虚构出一个字段用来判别是哪个表的。。
select infotitle,infoid,content,infotime,'table_a' as Info FROM [bds0020003_db].[dbo].[Info] where infotitle like '%基地%' or content like '%基地%' UNION ALL select newstitle,newsid,content,newstime,'table_b' as news FROM [bds0020003_db].[dbo].[news] where newstitle like '%基%' or content like '%基%' order by infotime desc
- UNION ALL多表搜索查询
- 【Oracle sql基础】多表查询中的集合操作union all、union、intersect、minus
- 分表后多表,UNION 和UNION ALL查询分页
- mysql组合查询(union和union all)
- sql查询语句UNION ALL
- mysql UNION ALL查询分页
- mysql 多表删除 和UNION 、UNION all的用法
- sql 查询结果合并union all用法
- oracle关联查询union all 讲解
- yii2.0 union all 查询 如何使用
- SQL Server-聚焦UNIOL ALL/UNION查询
- SQL union,union all,sql临时表
- sql语句查询结果合并union 和union all用法
- sql语句查询结果合并union 和union all用法
- sql语句查询结果合并union 和union all用法
- SQL联合查询优化 用union all来代替union
- sql语句查询结果合并union 和union all用法
- 组合查询中union 与union all的区别
- 扯蛋,扯蛋 asp从access转sqlserver后错误 rs.addnew,rs.update
- Notepad++常用插件
- kohana调用model模型ORM::factory($this->model)->table_columns();
- 【转载】配置Editplus的PHP调试环境
- php文档说明标签文档说明
- UNION ALL多表搜索查询
- kohana的路由roule设置modules/init.php
- db写法query
- kohana从模型model继承Model_Database获取数据库数据
- kohana控制器目录与类class写法关系class Controller_a_b_c_d_admin
- UILocalNotification的使用
- kohana视图view加载顺序 先加载模板 再定义变量
- kohana路由roule与模块modules的关系init.php(默认加载模块hmvc)
- kohana自定义site_url去除index.php