Hi,
I would like to convert the SQL code below to Sequel. Hopefully, after I
see the conversion, I will have a better understand on how Sequel handle
CROSS APPLY and VALUES and CTE
WITH C1 AS (
SELECT
MEMBER_ID, PARENT_GID,
ts,
Type,
e = CASE Type
WHEN 1
THEN NULL
ELSE ROW_NUMBER()
OVER (PARTITION BY MEMBER_ID, PARENT_GID, Type
ORDER BY END_DATE) END,
s = CASE Type
WHEN -1
THEN NULL
ELSE ROW_NUMBER()
OVER (PARTITION BY MEMBER_ID, PARENT_GID, Type
ORDER BY START_DATE) END
FROM Elig
CROSS APPLY (VALUES (1, START_DATE), (-1, END_DATE)) a(Type, ts)
)
SELECT * FROM C1
thank you.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/3170b181-3438-4e60-884f-ec0556ed51ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.