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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to WHERE clause

Status
Not open for further replies.

barkley1979

Technical User
Jun 24, 2003
11
GB
Is there an alternative to using the WHERE clause in SQL?
I am a complete beginner - I am basically using
SELECT * FROM * WHERE <criteria>
and that is about it. I have been told that the WHERE clause could potentially kill the server but the person telling me this cannot tell me why/how.
What alternatives do I have?
 
you don't have alternative

Ion Filipski
1c.bmp
 
So can you inform me what I have to be careful of? How can I write bad WHERE clauses? I cannot understand how, if I am writing WHERE x=1 AND y Not In (&quot;Hello&quot;,&quot;GoodBye&quot;) this can cause a problem.
 
You example does not cause a problem. If you are familiar with the layout of the database, and the appropriate tables have the appropriate indexes, and you have reasonable SQL skills, it is difficult to cause many problems. There are cases where you may write a query which produces a cartesion join (search google for more info) but I suggest that your friend is a bit of a scaremonger :)

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top