Re: mysql NOT operator

2004-11-07 Thread Frederic Wenzel
On Sat, 06 Nov 2004 20:34:47 -0800, L a n a <[EMAIL PROTECTED]> wrote: > However, NOT operator gives an error: > 3. SELECT data_id from table WHERE keyword = a NOT keyword =b ( returns sql > error) AND NOT as well as OR NOT should work, I think. How do you think MySQL would be able to distinguish

RE: mysql NOT operator

2004-11-07 Thread Donny Simonton
Why would have to write not, when your keyword=a will not return b to begin with? But if this was really just an example you would do this. SELECT data_id from table WHERE keyword = a AND keyword != b Donny > -Original Message- > From: L a n a [mailto:[EMAIL PROTECTED] > Sent: Saturday,

Re: mysql NOT operator

2004-11-07 Thread Jon Stephens
Your question is a bit confusing. Here are the possibilities using AND: SELECT id FROM table WHERE col1 = a AND col2 = b; SELECT id FROM table WHERE col1 = a AND col2 <> b; SELECT id FROM table WHERE col1 <> a AND col2 = b; SELECT id FROM table WHERE col1 <> a AND col2 <> b; [ BTW, you can also wri