<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MySQL: Query Real Values from Delimiter-Separated-String-IDs</title>
	<atom:link href="http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/</link>
	<description>Freelance Web and Software Developer</description>
	<lastBuildDate>Thu, 15 Jul 2010 14:20:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Chaoz</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-92</link>
		<dc:creator>Chaoz</dc:creator>
		<pubDate>Tue, 17 Nov 2009 04:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-92</guid>
		<description>yup that will do if not used in a query, but what I needed was the &#039;1, 2, 3&#039; to be used as part of a query :)</description>
		<content:encoded><![CDATA[<p>yup that will do if not used in a query, but what I needed was the &#8217;1, 2, 3&#8242; to be used as part of a query <img src='http://www.slickdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yk</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-91</link>
		<dc:creator>yk</dc:creator>
		<pubDate>Mon, 16 Nov 2009 22:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-91</guid>
		<description>The following code works for me:

SELECT value FROM my_table WHERE FIND_IN_SET(my_id, ′1, 2, 3′);

which is similar to the following code:

SELECT value FROM my_table WHERE my_id IN (’1′, ′2′, ′3′)</description>
		<content:encoded><![CDATA[<p>The following code works for me:</p>
<p>SELECT value FROM my_table WHERE FIND_IN_SET(my_id, ′1, 2, 3′);</p>
<p>which is similar to the following code:</p>
<p>SELECT value FROM my_table WHERE my_id IN (’1′, ′2′, ′3′)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaoz</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-86</link>
		<dc:creator>Chaoz</dc:creator>
		<pubDate>Thu, 02 Jul 2009 05:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-86</guid>
		<description>thanks for the tip!
I might check into that this weekend. =)</description>
		<content:encoded><![CDATA[<p>thanks for the tip!<br />
I might check into that this weekend. =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos Devia</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-85</link>
		<dc:creator>Carlos Devia</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-85</guid>
		<description>You should look at the function:
FIND_IN_SET

It could reduce the code needed.

Regards</description>
		<content:encoded><![CDATA[<p>You should look at the function:<br />
FIND_IN_SET</p>
<p>It could reduce the code needed.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-84</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Thu, 18 Jun 2009 08:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-84</guid>
		<description>Thanks Chaoz.  I&#039;m working with a MySQL procedure now that creates a temp table and it seems to be working as much as I should expect.  The real problem here is I don&#039;t have a scripting language.  It&#039;s a project at work, and we have fairly substandard systems; it&#039;s been a chore and a half just getting this to work with Excel and MS Query.  I think I&#039;ll have to go with a full php implementation, but I&#039;d rather not spend that much time on a company project (because I&#039;m a security guard for now).   Thank you again.</description>
		<content:encoded><![CDATA[<p>Thanks Chaoz.  I&#8217;m working with a MySQL procedure now that creates a temp table and it seems to be working as much as I should expect.  The real problem here is I don&#8217;t have a scripting language.  It&#8217;s a project at work, and we have fairly substandard systems; it&#8217;s been a chore and a half just getting this to work with Excel and MS Query.  I think I&#8217;ll have to go with a full php implementation, but I&#8217;d rather not spend that much time on a company project (because I&#8217;m a security guard for now).   Thank you again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaoz</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-83</link>
		<dc:creator>Chaoz</dc:creator>
		<pubDate>Tue, 16 Jun 2009 09:53:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-83</guid>
		<description>hi Jordan,

you cannot use the returned values as a resultset, its still a string but instead of the numbers separated by &quot;-&quot;, is now converted to your PhysicalZone names.

so example:

having ’001-002-003′ as your input... 

splitAndTranslate(’001-002-003′,’-&#039;) 

will return it into

’PhysicalZone1-PhysicalZone2-PhysicalZone3′

so its still a string.

What you want can be done via mysql Procedure, currently mysql Function does not do this.

Another way for you I can suggest is to get the PhysicalZone by using the function, split it by using your scripting language, (ex. php has &#039;explode&#039; function) then populate your &lt;b&gt;IN&lt;/b&gt; statement, then execute the query.

thanks</description>
		<content:encoded><![CDATA[<p>hi Jordan,</p>
<p>you cannot use the returned values as a resultset, its still a string but instead of the numbers separated by &#8220;-&#8221;, is now converted to your PhysicalZone names.</p>
<p>so example:</p>
<p>having ’001-002-003′ as your input&#8230; </p>
<p>splitAndTranslate(’001-002-003′,’-&#8217;) </p>
<p>will return it into</p>
<p>’PhysicalZone1-PhysicalZone2-PhysicalZone3′</p>
<p>so its still a string.</p>
<p>What you want can be done via mysql Procedure, currently mysql Function does not do this.</p>
<p>Another way for you I can suggest is to get the PhysicalZone by using the function, split it by using your scripting language, (ex. php has &#8216;explode&#8217; function) then populate your <b>IN</b> statement, then execute the query.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-82</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Mon, 15 Jun 2009 10:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-82</guid>
		<description>You showed in your first example a WHERE IN clause, how do you use this? 
my query returns zero rows:

SELECT PhysicalZone, Description FROM csidzone WHERE PhysicalZone IN (splitAndTranslate(&#039;001-002-003&#039;,&#039;-&#039;));</description>
		<content:encoded><![CDATA[<p>You showed in your first example a WHERE IN clause, how do you use this?<br />
my query returns zero rows:</p>
<p>SELECT PhysicalZone, Description FROM csidzone WHERE PhysicalZone IN (splitAndTranslate(&#8217;001-002-003&#8242;,&#8217;-'));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaoz</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-79</link>
		<dc:creator>Chaoz</dc:creator>
		<pubDate>Fri, 03 Apr 2009 01:45:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-79</guid>
		<description>I was contemplating on having a many-to-many relationships though I thought having this would be easier on my end _and_ I thought mysql would have an &#039;explode&#039; function like php... BIG mistake...it didn&#039;t LOL, so later on this bit me in the butt...</description>
		<content:encoded><![CDATA[<p>I was contemplating on having a many-to-many relationships though I thought having this would be easier on my end _and_ I thought mysql would have an &#8216;explode&#8217; function like php&#8230; BIG mistake&#8230;it didn&#8217;t LOL, so later on this bit me in the butt&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nico</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-78</link>
		<dc:creator>nico</dc:creator>
		<pubDate>Thu, 02 Apr 2009 20:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-78</guid>
		<description>Cool but... why having comma separated values in the first place?

http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html</description>
		<content:encoded><![CDATA[<p>Cool but&#8230; why having comma separated values in the first place?</p>
<p><a href="http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html" rel="nofollow">http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaoz</title>
		<link>http://www.slickdev.com/2008/09/15/mysql-query-real-values-from-delimiter-separated-string-ids/comment-page-1/#comment-76</link>
		<dc:creator>Chaoz</dc:creator>
		<pubDate>Thu, 19 Mar 2009 00:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.slickdev.com/?p=54#comment-76</guid>
		<description>Hi brad,

googling around, there is a function for that...

&lt;cfset result= ListToArray(result, &quot;,&quot;)&gt;

thanks</description>
		<content:encoded><![CDATA[<p>Hi brad,</p>
<p>googling around, there is a function for that&#8230;</p>
<p>&lt;cfset result= ListToArray(result, &#8220;,&#8221;)&gt;</p>
<p>thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
