Assuming this is mostly compatible SQL; the problem with your query is that it has two where clauses. You can have one where clause and multiple filters defined using the 'and' keyword. This is what your SQL should read: select * from mytable where (field1 like %word% or field2 like %word%) and (field3 = number) Play with the parenthesis rather then place another 'where' keyword in the same SQL statement. regards, Adi Gadwale. On Sat, 10 Jun 2000, Brevsville Administrator wrote:
I am not very good at SQL I'm just a lowly java programmer. So I have no ideas why this SQl statement is wrong:
select * from mytable where field1 like %word% or field2 like %word% and where field3 = number
if I leave the "and where field3 = 2 " out the query works.
The column is an int so that should work and indeed if I use "select * from mytable where field3 = 2" that works....
What is wrong with this (or me) ?
Thanx
Chris I'm lazy.. I'd rather smile and be happy, than work my face muscles so hard to frown... why not join me!!!
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/