wjmmml(笑着悲伤) :
不好意思,是这样的,第一,数据库不是我设计的,
第二,数据量很大,一张表有可能上几十万条,所以分开.这不是我决定的事,请帮忙
不好意思,是这样的,第一,数据库不是我设计的,
第二,数据量很大,一张表有可能上几十万条,所以分开.这不是我决定的事,请帮忙
解决方案 »
- 数据库时间类型为date,jsp获得是string类型,两者怎么比较
- 刚刚安装好java web相关软件 做第一个JSP程序时候出现得问题?急……
- 我用JFreeChart的ChartFactory.createXYLineChart不能完全显示图表。
- JSP网页中下拉列表的问题
- 急!请各位高手指点
- 如何在关闭弹出窗口的同时刷新父窗口呢?(急)
- 求助:对session比较熟悉的进来!
- 测试
- 请问免费web容器性能何种配置最好?
- bootstrap table中如何通过js修改th标签中属性值
- 为什么我修改了bean以后,用//ip:8080/?.jsp和//localhost:8080/?.jsp访问结果不一样
- 有没有初一回家(河南)的呀,大家同行!
不要建临时视图呀。
如果多线程就出错呀。
建议直接得到如下SQL
select * from table1
union
select * from table2
union
select * from table3
把你的SQL语句全部打出来看看。然后在数据库中去查询,看看结果。
贴出来!
select * from table1 union select distinct * from table2
==
select distinct * from table1
select distinct * from table2 两表的记录加在一起我的意思是,用了UNION后,就好象有这样的结果,不知道对不对,请告诉我!!!1
给你看看我的SQL,连接的时候,要分别处理的.你要自己筛掉.如果不行,把你的表结构贴出来.我再帮你看看.最好把你的实际的SQL语句贴出来.
sql="select a.*,b.agent_name,c.Name as group_name from DIR_NUM_RES a,dir_agent_info b,DIR_SECU_GROUP c "+
"WHERE (a.agent_id = b.agent_id and a.agent_id is not null) "+
"and (a.group_id=c.group_id and a.group_id is not null) and a.NUM_NO like '%" + FromNum + "%' "+
" union "+
"select a.*,'未分配' as agent_name,c.Name as group_name "+
"from DIR_NUM_RES a,DIR_SECU_GROUP c "+
"where a.agent_id is null "+
"and a.group_id is not null "+
"and a.group_id=c.group_id and a.NUM_NO like '%" + FromNum + "%' "+
"union "+
"select a.*,'未分配' as agent_name,'未分配' as group_name from DIR_NUM_RES a "+
"where a.agent_id is null and a.group_id is null and a.NUM_NO like '%" + FromNum + "%' ";