Jump to content

Archived

This topic is now archived and is closed to further replies.

Wetzut

select syntax wrong?

Recommended Posts

hi

 

i\'ve a prob:

 

i need to select some rows from my table. every row got an id.

How can i get all these rows with diffrent ids into one select query?

 

i tried this:

 

select * from `my_table` where `id` = ( \'2\',\'3\',\'6\',\'27\')

 

is it possible to solve this problem in this way or must i try an other one?

 

thx 4 help

Share this post


Link to post
Share on other sites

select * from `my_table` where `id` = 2 || `id` = 3 || `id` = 6 || `id` = 27

 

Hope this helps

Share this post


Link to post
Share on other sites

Yes it works great. Thx for help

 

 

(What means this \"||\" in this case? Same as an AND or an OR? Because i tried out my select with an AND instead of ||)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.