Could you help me with this case?? I need to transcribe the SQL below to Arel:
select sum(X.l_c_v_case) as case
from fc_low F1,
TABLE (pg_fg001.fmjc(f1.rowid,trunc(SYSDATE))) V1
WHERE V1.fic = ? and v1.fiu = ?
AND V1.fst IN ('A', 'B', 'C')
AND NVL(V1.ftm,0) NOT IN (701, 711, 721, 731)
Thanks.
I am not sure how this query is working at the moment due to 2 issues:
X.l_c_v_case; andThat being said the AST does not care from an assembly standpoint so we can convert your query to
Arelas follows: (this does not mean the query will work when executed See Above Comments)Output of
query.to_sql