select id,money,pubdate,user from a
union all
select id,money,pubdate,user from b
where pubdate between 起始时间 and 结束时间
union all
select id,money,pubdate,user from b
where pubdate between 起始时间 and 结束时间
解决方案 »
- 诚求数据库学习规划
- 请问PostgreSQL的客户端, 报0x00002745/10053错误.
- 求助!系统dsn为空,无法连接数据库。
- SQL语句如何做递归查询
- 哪位大虾帮一下小弟,新建MYSQL数据库TEST和表USER,造了一条数据.为什么用SQL查询时报数据库中的表不存在?
- My sql 更新表数据问题
- 如果字段类型是int系列的,比如id smallint(4),可以update set id=id+1...,但如果字段类型是varchar(255)呢
- order by 的问题
- mysql数据记录导出后无法换行,请问如何处理?
- MYsql中如何计算某列除以该列的总和
- 请教mysql高手!!
- 帮忙看看下面的SQL语句怎么转换成连接查询,谢谢!急用,在线等
union all
select sum(money) as a from b
where pubdate between 起始时间 and 结束时间;