SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Thread: except queries
-
Jan 30, 2005, 20:06 #1
- Join Date
- Oct 2004
- Location
- United states
- Posts
- 663
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
except queries
Hi.
can any1 of you help me out?
i need to run this queries;
select keyword, id from table where keyword like %keyword%, but i need to exclude some id.
lets say i need to exculde id=3
the queries would be
select keyword, id from table where keyword like %keyword% exclude id = 3
please help me...
thank you so much!!!!Valentine's Day Gift for your girl,
but you have to know her size
have a nice day then.
-
Jan 30, 2005, 20:16 #2
- Join Date
- Jun 2003
- Location
- Melbourne, AU
- Posts
- 1,142
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Maybe this...
Code:SELECT keyword, id FROM table WHERE keyword LIKE '%keyword%' AND id != 3
Lats...
-
Jan 30, 2005, 20:16 #3
- Join Date
- Oct 2004
- Location
- Portugal
- Posts
- 41
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:SELECT keyword, id FROM table WHERE keyword LIKE '%whatever%' AND id <> 3
-
Jan 30, 2005, 20:18 #4
- Join Date
- Oct 2004
- Location
- United states
- Posts
- 663
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
oh yeah.....
that is cooll....
can i have mulitple exception?
like
and id != 3 and id !=4 and id !=5?
i believe there is another way to do it right/?
thankz!Valentine's Day Gift for your girl,
but you have to know her size
have a nice day then.
-
Jan 30, 2005, 20:20 #5
- Join Date
- Oct 2004
- Location
- Portugal
- Posts
- 41
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:SELECT keyword, id FROM table WHERE keyword LIKE '%whatever%' AND id <> 3 OR id <> 4 OR id <> 6
-
Jan 30, 2005, 20:23 #6
- Join Date
- Jun 2003
- Location
- Melbourne, AU
- Posts
- 1,142
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A bit neater...
Code:SELECT keyword, id FROM table WHERE keyword LIKE '%keyword%' AND id NOT IN(3,4,5)
Lats...
-
Jan 30, 2005, 20:26 #7
- Join Date
- Oct 2004
- Location
- Portugal
- Posts
- 41
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I knew there was another and better way!
Great Lats
-
Jan 30, 2005, 20:39 #8
- Join Date
- Oct 2004
- Location
- United states
- Posts
- 663
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
COooll stuff
thank you everyone.
Valentine's Day Gift for your girl,
but you have to know her size
have a nice day then.
-
Jan 31, 2005, 05:13 #9
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
gesf, your query will return all rows in the table
be careful when mixing ANDs and NOTs and ORs
Bookmarks