Subject Re: [firebird-support] Is such a CASE WHEN usage allowed?
Author Arno Brinkman
Hi,

What about:

SELECT
tSaleinvoice.*
FROM
tSaleInvoice
WHERE
EXISTS(SELECT * FROM tSaleInvoiceCvrLtr WHERE tSaleInvoice.iID =
tSaleInvoiceCvrLtr.cSaleInvIDs and tSaleInvoiceCvrLtr.iID = :vp_iID) or
(iBuyerID = :iBuyerID AND tSaleInvoice.tDt = :tDt)

Regards,
Arno Brinkman