I have a sql statement
SELECT emp.id, emp.name,
FROM emp, office, payment
WHERE emp.id = office.empid
AND payment.id = emp.pay
but I actually want the
AND payment.id = emp.pay
to be executed conditionally. It should not execute always. For e.g. it should execute only if emp.pay is NOT NULL