I am writing one query, that needs to satisfy the following conditions.
select
field1, field2, field3
from
`tabFirstTable`as ft join
`tabSecondTable` as st
where
--Upto above its fine but how to turn below logic into query--
IF ft.approval_status in == 'Approved By Manager' and ft.status in ("Created", "Error")
and //some more conditions
ELSE ft.approval_status in == 'Approved By HOD' and ft.status in ("Initiated")
and //some more conditions
Because of the above issue currently writing two separate queries, which is not a good idea. Please help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…