- Code: Select all
SELECT (case when (count(*)!=0) \
then ( ( cast(sum(case when flg_f_first_raise then 1 else 0 end) as real) ) \
/( cast(sum(case when flg_f_check then 1 else 0 end) \
+ sum(case when flg_f_first_raise then 1 else 0 end) as real)) \
) \
else (-1) \
end) as result \
i get some value from this query they are very simular to what I need but not very much
where is error in my query?
