Gossamer Forum
Home : General : Databases and SQL :

where ... or....

Quote Reply
where ... or....
i wonder what is the correct query?

select * from table where columnx=id1,id2,id3

select * from table where columnx=id1 or columnx=id2 columnx=id3

many thanks in advance
Quote Reply
Re: [courierb] where ... or.... In reply to
Try them both :)
Quote Reply
Re: [courierb] where ... or.... In reply to
Or the better thing to do is use the IN function....

select *
from table
where (columnx IN (id1,id2,id3))
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] where ... or.... In reply to
Thanks
the last one works for me. Thanks you