Wetzut Posted March 25, 2003 Share Posted March 25, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/267-select-syntax-wrong/ Share on other sites More sharing options...
shivabharat Posted March 25, 2003 Share Posted March 25, 2003 select * from `my_table` where `id` = 2 || `id` = 3 || `id` = 6 || `id` = 27 Hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/267-select-syntax-wrong/#findComment-796 Share on other sites More sharing options...
Wetzut Posted March 25, 2003 Author Share Posted March 25, 2003 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 ||) Quote Link to comment https://forums.phpfreaks.com/topic/267-select-syntax-wrong/#findComment-798 Share on other sites More sharing options...
shivabharat Posted March 25, 2003 Share Posted March 25, 2003 Yes u are right || is AND && is OR Quote Link to comment https://forums.phpfreaks.com/topic/267-select-syntax-wrong/#findComment-799 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.