Forum Moderators: coopster

Message Too Old, No Replies

SQL multiple WHERE clause

         

AndyD

7:49 pm on Jun 25, 2004 (gmt 0)

10+ Year Member



Is it possible in SQL to have a multiple Where clause when interrogating a database?

Select wines WHERE category = "Wine" and subcategory = "Red"

So that I can select only Red or White wines to display in a table.

Andrew

AndyD

7:53 pm on Jun 25, 2004 (gmt 0)

10+ Year Member



Forget that.... I'm being thick! Just worked out what to do, not sure why the code didn't work first time round...

Select * from wines WHERE category = "Wine" AND subcategory = "Red"

It does work!

ergophobe

8:08 pm on Jun 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If that's the actual code instead of just shorthand for the purposes of posting, it's because the first time around there was no FROM clause.

Tom