Я получил письмо сотрудника по электронной почте с запросом, которого больше нет в компании, и я пытаюсь понять, о чем он говорит.
, case when regexp_substr(c_qty, '[^|]+', 1, 1) <> nvl(sum(cd.actl_qty),0)
then regexp_substr(c_qty, '[^|]+', 1, 1) - nvl(sum(cd.actl_qty),0) else null end Curr_Var
, case when regexp_substr(c_qty, '[^|]+', 1, 1) is null then 'First Count'
when regexp_substr(c_qty, '[^|]+', 1, 1) = nvl(sum(cd.actl_qty),0)
then 'Processed'
when regexp_substr(c_qty, '[^|]+', 1, 1) > 0 and (regexp_substr(c_qty, '[^|]+', 1, 2) > 0 or regexp_substr(c_qty, '[^|]+', 1, 2) is null) and sum(cd.actl_qty) is null
then 'Recount'
when regexp_substr(c_qty, '[^|]+', 1, 1) <> nvl(sum(cd.actl_qty),0)
and regexp_substr(c_qty, '[^|]+', 1, 1) = case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>1 then regexp_substr(c_qty, '[^|]+', 1, 2) else null end
then 'Confirmed'
when regexp_substr(c_qty, '[^|]+', 1, 1) <> nvl(sum(cd.actl_qty),0)
and (regexp_substr(c_qty, '[^|]+', 1, 2) = nvl(sum(cd.actl_qty),0)
or regexp_substr(c_qty, '[^|]+', 1, 3) = nvl(sum(cd.actl_qty),0)
or regexp_substr(c_qty, '[^|]+', 1, 4) = nvl(sum(cd.actl_qty),0)
or regexp_substr(c_qty, '[^|]+', 1, 5) = nvl(sum(cd.actl_qty),0)
or regexp_substr(c_qty, '[^|]+', 1, 6) = nvl(sum(cd.actl_qty),0))
then 'Expire Recent'
when regexp_substr(c_qty, '[^|]+', 1, 1) <> nvl(sum(cd.actl_qty),0)
and case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>1 then regexp_substr(c_qty, '[^|]+', 1, 2) else null end is null
then 'Recount'
when regexp_substr(c_qty, '[^|]+', 1, 1) <> nvl(sum(cd.actl_qty),0)
and regexp_substr(c_qty, '[^|]+', 1, 1) <> case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>1
then regexp_substr(c_qty, '[^|]+', 1, 2) else null end then 'Recount' else null end Directive
, regexp_substr(c_qty, '[^|]+', 1, 1) as Last_Cnt
, case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>1 then regexp_substr(c_qty, '[^|]+', 1, 2) else null end as Prev_Cnt1
, case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>2 then regexp_substr(c_qty, '[^|]+', 1, 3) else null end as Prev_Cnt2
, case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>3 then regexp_substr(c_qty, '[^|]+', 1, 4) else null end as Prev_Cnt3
, case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>4 then regexp_substr(c_qty, '[^|]+', 1, 5) else null end as Prev_Cnt4
, case when LENGTH(c_qty)-LENGTH(REPLACE(c_qty,'|',''))>5 then regexp_substr(c_qty, '[^|]+', 1, 6) else null end as Prev_Cnt5
Я безуспешно пытался исследовать утверждения, может кто-нибудь объяснить мне, пожалуйста, спасибо.