我正在向SQL Guru报告,以解决我的问题。我有一个表,其中包含字段:日期、标题、收款和付款,我要检索2014年7月1日至2014年8月31日的数据,即余额(收款-付款)和2014年9月1日至2014年9月30日的i.e.current_month(收款-付款)
(注:以上日期是参数形式,我在这里定义硬编码是为了清楚我的问题)
发布于 2014-10-22 00:14:12
select *
from your_table
where (date >= '07/01/2014' and date <= '08/31/2014') or
(date >= '09/01/2014' and date <= '09/30/2014')https://stackoverflow.com/questions/26491271
复制相似问题