tag:blogger.com,1999:blog-33985576.post180130904846144403..comments2013-03-06T07:09:28.987-08:00Comments on The Blog of Phill: MySQL IN clause gemAnonymoushttp://www.blogger.com/profile/09794000549308292885noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-33985576.post-32936076648841401412013-03-06T07:09:28.987-08:002013-03-06T07:09:28.987-08:00You could use the OR condition like this:
SELECT ...You could use the OR condition like this:<br /><br />SELECT *<br />FROM tbl_name<br />WHERE value_x <br />IN ('field_name_1', 'field_name_2', 'field_name_3', 'field_name_x')<br />OR value_y<br />IN ('field_name_1', 'field_name_2', 'field_name_3', 'field_name_x')Anonymoushttps://www.blogger.com/profile/09794000549308292885noreply@blogger.comtag:blogger.com,1999:blog-33985576.post-49897735165805218322013-03-06T06:09:27.513-08:002013-03-06T06:09:27.513-08:00But if the condition is like this
(val1,val2) in ...But if the condition is like this <br />(val1,val2) in (field1,field2)Anonymoushttps://www.blogger.com/profile/04227272871538202786noreply@blogger.comtag:blogger.com,1999:blog-33985576.post-85573798018707933122013-03-06T06:08:43.057-08:002013-03-06T06:08:43.057-08:00What if something is like this
(value1,value2) in...What if something is like this <br />(value1,value2) in (field1,feild2)Anonymoushttps://www.blogger.com/profile/04227272871538202786noreply@blogger.comtag:blogger.com,1999:blog-33985576.post-13514525946208595972010-01-20T09:00:30.644-08:002010-01-20T09:00:30.644-08:00That was very useful indeed! but can you suggest a...That was very useful indeed! but can you suggest a solution for this:<br />If your query value is: 'MNOPQRSTUVLMNOPSDT'<br />Then, the select should fetch records like, say, NOPQ or STUVLMN or OPQRSTUV or PSDT or etc from the database.<br />Is it possible to get it done using WHERE IN clause?<br /><br />Not sure what you mean, but maybe try %LIKE%Anonymoushttps://www.blogger.com/profile/09794000549308292885noreply@blogger.comtag:blogger.com,1999:blog-33985576.post-84002397855890830102010-01-19T04:06:31.305-08:002010-01-19T04:06:31.305-08:00That was very useful indeed! but can you suggest a...That was very useful indeed! but can you suggest a solution for this:<br />If your query value is: 'MNOPQRSTUVLMNOPSDT'<br />Then, the select should fetch records like, say, NOPQ or STUVLMN or OPQRSTUV or PSDT or etc from the database.<br />Is it possible to get it done using WHERE IN clause?Poornima Helene Ravihttps://www.blogger.com/profile/16957902558809706075noreply@blogger.comtag:blogger.com,1999:blog-33985576.post-84375571437308002472009-11-19T23:46:19.818-08:002009-11-19T23:46:19.818-08:00Good to know this..
Thanks phill for the useful po...Good to know this..<br />Thanks phill for the useful post.<br /><br />though it seems the field_name should <b>not</b> be quoted.Chitwan Malhotrahttps://www.blogger.com/profile/15768227236497178314noreply@blogger.com