I'm creating a report with iReport over an Oracle DB. I have to select some values depending on a condition like this:
AND EXISTS (SELECT 1 FROM TABLE_1 WHERE x = y)
OR EXISTS (SELECT 1 FROM TABLE_2 WHERE z = y)
is it possible to execute the second EXISTS only if the first is false?
Try to use your conditions in brackets:
AND (
EXISTS (SELECT 1 FROM TABLE_1 WHERE x = y)
OR EXISTS (SELECT 1 FROM TABLE_2 WHERE z = y)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With