Subject | Order of WHERE operations |
---|---|
Author | Rick DeBay |
Post date | 2005-01-13T22:04:16Z |
In what order to WHERE statements get evaluated? I want to make sure
the existence clause gets evaluated first.
INSERT INTO PURCH_ORDER (PO,REPLENISH_GRP,ACCOUNT,DIST_CTR,SUBMITTED)
SELECT ?,REPLENISH_GRP_ID,?,?,?
FROM V_REPLENISH_GRP
WHERE SUPPLIER_ACCT=?
AND NOT EXISTS (SELECT ID FROM PURCH_ORDER WHERE PO=?);
Rick DeBay
Senior Software Developer
RxStrategies.net
the existence clause gets evaluated first.
INSERT INTO PURCH_ORDER (PO,REPLENISH_GRP,ACCOUNT,DIST_CTR,SUBMITTED)
SELECT ?,REPLENISH_GRP_ID,?,?,?
FROM V_REPLENISH_GRP
WHERE SUPPLIER_ACCT=?
AND NOT EXISTS (SELECT ID FROM PURCH_ORDER WHERE PO=?);
Rick DeBay
Senior Software Developer
RxStrategies.net