问一句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表吧 这几句话是什么意思,帮忙解释一下哈 会员之间发送短信是如何实现 这样定义变量什么意思 求一sql 语句 匹配问题 如何从数据库中随机取出一条数据 两个类的概念问题:关于类中函数得的“默认值”及其他 关于$_GET之类的说明 php上传问题 怎么打印出thinkphp控制器下的所有方法 关于&的操作符问题 看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应该是索引,然后再从这个表出数据。