Query:
SELECT TODAY,
TO_CHAR(TODAY,'IW') "WEEK_NUM"
from (select (TO_DATE('01/01/'||TO_CHAR(2021), 'DD/MM/YYYY') - 1) + level TODAY
from DUAL
connect by LEVEL <= 366)
Result:
Solucionando problemas que os clientes não sabem que têm, de uma forma que eles jamais entenderiam...
Query:
SELECT TODAY,
TO_CHAR(TODAY,'IW') "WEEK_NUM"
from (select (TO_DATE('01/01/'||TO_CHAR(2021), 'DD/MM/YYYY') - 1) + level TODAY
from DUAL
connect by LEVEL <= 366)
Result:
Query:
SELECT * FROM (SELECT WEEK_YEAR, WEEK_NUM, MIN(TODAY) START_DATE, MIN(TODAY) + 6 END_DATE
FROM (SELECT EXTRACT(YEAR FROM TODAY) WEEK_YEAR, TODAY,
TO_CHAR(TODAY,'IW') "WEEK_NUM"
from (select (TO_DATE('01/01/'||TO_CHAR(2021), 'DD/MM/YYYY') - 1) + level TODAY
from DUAL
connect by LEVEL <= 368))
GROUP BY WEEK_YEAR, WEEK_NUM
ORDER BY START_DATE)
WHERE WEEK_YEAR = 2021
AND NOT (EXTRACT(MONTH FROM START_DATE) = 1 AND WEEK_NUM > 10)
Result:
-- Criar compose nano docker-compose.yml version: '3.7' ### services: db: image: postgres volumes: - postgres_data:...