|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
Join Date: Oct 2003
Location: New Zealand
Posts: 58
|
SQL Help
Hi
I am new to SQL and when using the 'select * from whatever where columnname = whatever' can I have 2 of the 'where' parts So instead of having 1 condition like here, can I have 2 conditions? Thank you Last edited by jasontung; 01-01-2004 at 03:23 AM. |
|
|
|
|
|
#2 |
|
Member (7 bit)
Join Date: Aug 2002
Posts: 64
|
hi,
sure you can have many conditions like: select * from customer where state = 'NJ' and id = 123 just keep using the AND keyword to add another condition to the where clause. |
|
|
|
|
|
#3 |
|
Member (6 bit)
Join Date: Oct 2003
Location: New Zealand
Posts: 58
|
OK, Thank you for the relpy
|
|
|
|
|
|
#4 |
|
Professional gadfly
|
You can have as many as you want, connecting AND, OR and NOT. You can usually use things like BETWEEN as well, depending on the implementation. Use parentheses to make things clear.
In some of the queries I have constructed, I have lots of where clauses, such as selecting all the people whose addresses start with this and who ordered between these to dates and who haven't received their order yet but have paid. That kind of thing. |
|
|
|
|
|
#5 |
|
Member (6 bit)
Join Date: Oct 2003
Location: New Zealand
Posts: 58
|
Thank you
I see now |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|