我想運行一個查詢像生成日期範圍天行(非連續)
SELECT distinct(generate_series(timestamp start_date, interval '1' day) as d
FROM NAEDO
WHERE start_date >= '2014/08/13'
AND start_date <= '2014/09/12'
ORDER BY start_date
而像返回數據:(以天數範圍,但是從數據[可能的非連續天數])
days
---
13
16
17
18
25
29
1
3
爲什麼不這樣做:'select distinct start_date form NAEDO'? – 2014-09-23 12:53:33
你如何提取一天? – morne 2014-09-23 12:54:07
摘錄(從start_date開始的日期) – hbn 2014-09-23 12:56:15