Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL operation order

Status
Not open for further replies.

doeksen

Programmer
Oct 26, 2004
1
US
How does the statement below executes? It has 2 conditions the first on “NAME” and the second on “VALUE”. If the first condition is never true does it NOT execute the second condition, thus never executing the select “SELECT VALUE FROM SOMETABLE”.

Any insight would be helpful.

SELECT A FROM ITEM_TABLE
WHERE NAME = ‘NO RESULT’ AND VALUE IN (SELECT VALUE FROM SOMETABLE)

Thank you
 
This depend on the execution plan build by the query optimizer.
Best result if ITEM_TABLE.NAME, ITEM_TABLE.VALUE AND SOMETABLE.VALUE are indexed.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top