问一句SQL语句.先谢谢了!!! select * from table_1,table_2,table_3 where table_1.date=table_2.date=table_3.date and table_1.date between 20080909 and 20090706; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我不需要date相同,还有最好能按日期倒序排列. 20080909 and 20090706;你还可以根据需要改成表单提交过来的时间, 排列顺序也可以在后面加上!呵呵 做数据过滤! 单表选取,然后每条SQL间用UNION连接。select * from table1 where $condition unionselect * from table2 where $condition union... 在最后加order by date desc; 错了,可以排序,但是怎样用table1.date这样的方法区分结果?除了union有没有别的方法,谢谢. 区分不要管他了,除了union有没有别的办法 select * from (select 'table1' as tablaName, * from table1 where $condition union select 'table2' as tablaName, * from table2 where $condition union ...)order by date desc;数据量大的话,还是自己专门做个表先将union数据insert by select进去吧。 表里的date应该是索引,然后再从这个表出数据。 另外,如果你的数据量不少,操作又比较频繁,那么建议你还是用MERGE表吧 获取地址栏url中的域名 困惑了 PHP/Java Bridge 问题---发在 Java 区没人理这里的同学们帮帮忙啊! Cakephp 里面 怎么用checkbox 来实现 选中行删除 ,求 c 和v 里面的相关代码 谢谢 最好举例子 着急 在线等。。。 如何获取下拉列框中,循环显示的某个特定的值? head()相关问题 验证码问题~~急~~~ 求助,关于数据库查询的问题 发个与正则表达式练习程序 [求教]win2000+apache+php4 的安装方法.. 关于&的操作符问题 看CSDN的的迷茫
你还可以根据需要改成表单提交过来的时间, 排列顺序也可以在后面加上!呵呵 做数据过滤!
union
select * from table2 where $condition
union
...
select 'table1' as tablaName, * from table1 where $condition
union
select 'table2' as tablaName, * from table2 where $condition
union
...)
order by date desc;数据量大的话,还是自己专门做个表先将union数据insert by select进去吧。 表里的date应该是索引,然后再从这个表出数据。