现在有十二个表,表的结构,字段,列名等都是一样,只是因为数据太多了,分成十二张表存放,现在请用sql查询出十二表指定用户的数据
例:
表1:select * from table_1 where table_id=222;
表2:select * from table_2 where table_id=222;
表3:select * from table_3 where table_id=222;
.
.
.
表12:select * from table_12 where table_id=222;
如何用sql语句把这十二个sql连结起来,或者用sql达到相同的结果即可。sql数据库
例:
表1:select * from table_1 where table_id=222;
表2:select * from table_2 where table_id=222;
表3:select * from table_3 where table_id=222;
.
.
.
表12:select * from table_12 where table_id=222;
如何用sql语句把这十二个sql连结起来,或者用sql达到相同的结果即可。sql数据库
解决方案 »
- orcale安装时的问题
- 谁有oracle客户端安装软件啊 发我邮箱[email protected] 十分感谢
- 为什么在存储过程中不能访问表DBA_OBJECTS ?
- PL/SQL Developer 和 Oracle Developer 2000
- 请教这样一个优化的问题
- 如何限制用户访问
- 这个索引怎么无论如何也不能生效呢?
- select a.* from smtopm a INNER JOIN iir b on a.item_key!=b.itm_key上面这句话有什么好的方法使执行时间更短,还有为什么这句话会产生
- 请问:oracle如何查询没有重复的记录,只查几个字段。
- Oracle中有些字符无法插入怎么办?例如——(破折号),显示的是??
- 如何求二个时间间的间隔
- 请教 Oracle 备份操作手册
union all
select * from table_2 where table_id=222
union all
select * from table_3 where table_id=222
......就可以了