Zmiany pomiędzy wersją 30 and wersją 31 dla DeployerGuide/Custumization/AdvancedReporting/SQLExamples
- Data i czas:
- 04/14/15 23:58:05 (10 years temu)
Legend:
- Bez zmian
- Dodane
- Usunięte
- Zmienione
-
DeployerGuide/Custumization/AdvancedReporting/SQLExamples
v30 v31 18 18 -- Zwraca kalendarz dni, nr tygodnia, miesiąć dla bieżącego roku 19 19 -- przydatne do JOIN-owania z zapytaniami 20 SELECT ndate, nday, to_char(ndate, 'D')::int - 1 AS dayweek, to_char(ndate, 'WW') AS week, to_char(ndate, 'MM') AS month FROM 20 SELECT ndate, nday, 21 date_part('day', ndate) || '(' || to_char(ndate, 'Dy') || ')' AS day, 22 to_char(ndate, 'D')::int - 1 AS dayweek, to_char(ndate, 'WW') AS week, to_char(ndate, 'MM') AS month FROM 21 23 ( 22 24 SELECT sr.sr AS nday, (date_trunc('year', now()) + (sr.sr || 'day')::interval)::date AS ndate 23 25 FROM generate_series(0,365) AS sr 24 26 ) AS calendar 27 25 28 26 29