guitarist809 Posted March 20, 2007 Share Posted March 20, 2007 Hello, Is there a way to do a query like this? SELECT `field1`,`field2`,`field3` FROM `mytable` WHERE `field1` = 1 OR WHERE `field1` = 2 OR WHERE `field1` = 8 If you didn't get what I was trying to do I'm trying to select some rows where "field1" can either be 1, 2, or 8. How can I do this? Thanks, -Matt Link to comment https://forums.phpfreaks.com/topic/43585-solved-mysql-query-questions/ Share on other sites More sharing options...
AndyB Posted March 21, 2007 Share Posted March 21, 2007 ... WHERE `field` IN (1,2, Link to comment https://forums.phpfreaks.com/topic/43585-solved-mysql-query-questions/#findComment-211692 Share on other sites More sharing options...
artacus Posted March 21, 2007 Share Posted March 21, 2007 Yep and if you need to add additional where clauses, you separate them with either AND or OR but you only use WHERE on the first one. Link to comment https://forums.phpfreaks.com/topic/43585-solved-mysql-query-questions/#findComment-211697 Share on other sites More sharing options...
guitarist809 Posted March 21, 2007 Author Share Posted March 21, 2007 Sweet thx! [solved] Link to comment https://forums.phpfreaks.com/topic/43585-solved-mysql-query-questions/#findComment-211751 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.