Post #532
1.03K
- 👍 8
- 🤣 2
- 🔥 1
СО @sovcom_tech
Showing posts older than #533 · Back to latest















select s, count(*)
from (select to_char(to_date('2022', 'yyyy') + level - 1, 'day') s
from dual
connect by level < add_months(to_date('2022', 'yyyy'), 12) - to_date('2022', 'yyyy') + 1) group by s
2️⃣ Такой вариант работает в 14 раз быстрееselect to_char(trunc(to_date('2022', 'yyyy'), 'd') + (x -1), 'day'), 52 + decode(x, s, 1, 0) + decode(x, mod(s + 1, ly_mod), 1, 0)
from (select level x,
to_char(to_date('2022', 'yyyy'), 'd') s,
decode(extract(day from last_day(to_date('2022', 'yyyy') + 31)), 29, 7) ly_mod
from dual
connect by level <= 7)
📢 Решил задачку? Отлично. Будем рады видеть тебя в нашей команде. 

import _ from "lodash", можно сделать так import isEmpty from "lodash/isEmpty"
Декомпозируйте