I have been given a stored procedure to optimize which contains a very complicated If/Then Select. The worst (as far as I can tell) part of the IF/Then contains a query with a complicated Inner Join setup and a Where statement with no less than 6 main conditions and 2 - 10 nested subqueries within each main condition.
OY VEY!!!!
So, I'm hear to pick brains.
Does anyone have any opinions on whether the use of IN is better than the use of = (aside from the fact that IN is prettier) during complicated queries?
What about experience with the keywords AND NOT in front of the conditional versus AND <conditional> NOT IN or AND <conditional> <> ?
Let me know if you want me to post the WHERE clause. It's pretty messy. I had to print it out and circle all the nested stuff so I could tell what went with what... @=/
Thanks in Advance!!
Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
OY VEY!!!!
So, I'm hear to pick brains.
Does anyone have any opinions on whether the use of IN is better than the use of = (aside from the fact that IN is prettier) during complicated queries?
What about experience with the keywords AND NOT in front of the conditional versus AND <conditional> NOT IN or AND <conditional> <> ?
Let me know if you want me to post the WHERE clause. It's pretty messy. I had to print it out and circle all the nested stuff so I could tell what went with what... @=/
Thanks in Advance!!
Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???