2 задачка по СКЛ. Вроде норм

This commit is contained in:
Aysat
2025-11-26 14:53:10 +06:00
parent 1e2adfc3e9
commit 74ba96eb98
+23
View File
@@ -0,0 +1,23 @@
with base as (
select
employee_id,
to_dt,
from_dt,
lag(to_dt) over (partition by employee_id order by from_dt) lag_to_dt
from abakhytbekuly.salary
),
error as (
select
employee_id,
from_dt,
case when
lag_to_dt > from_dt then 'пересечение'
when
lag_to_dt < from_dt then 'дыра'
end as status
from base
where lag_to_dt is not null
)
select *
from error
order by employee_id, from_dt