 




<?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: query for  join</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/query-for-join/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/query-for-join/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 05:16:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: mrdenny</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/query-for-join/#comment-64243</link>
		<dc:creator>mrdenny</dc:creator>
		<pubDate>Thu, 04 Jun 2009 20:11:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-64243</guid>
		<description><![CDATA[A table redesign is the way to go here.  This is one of the many reasons that you don&#039;t store more than one value in a single field.]]></description>
		<content:encoded><![CDATA[<p>A table redesign is the way to go here.  This is one of the many reasons that you don&#8217;t store more than one value in a single field.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darryn</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/query-for-join/#comment-64174</link>
		<dc:creator>darryn</dc:creator>
		<pubDate>Wed, 03 Jun 2009 10:37:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-64174</guid>
		<description><![CDATA[Or, update your query (should work, but haven&#039;t tested). 

select r.unitid ,(select distinct description from unittypes where 
unittypes.unitid in ( (&#039;&#039;&#039;&#039;+ REPLACE(r.unitid,&#039;,&#039;,&#039;&#039;&#039;&#039;+&#039;,&#039;+&#039;&#039;&#039;&#039;)+&#039;&#039;&#039;&#039;) ) FOR XML PATH(&#039;&#039;) ) o 
from rules r 

Agree with advice from Msi77 though, it would be better to change the design.]]></description>
		<content:encoded><![CDATA[<p>Or, update your query (should work, but haven&#8217;t tested). </p>
<p>select r.unitid ,(select distinct description from unittypes where<br />
unittypes.unitid in ( (&#8221;&#8221;+ REPLACE(r.unitid,&#8217;,',&#8221;&#8221;+&#8217;,'+&#8221;&#8221;)+&#8221;&#8221;) ) FOR XML PATH(&#8221;) ) o<br />
from rules r </p>
<p>Agree with advice from Msi77 though, it would be better to change the design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msi77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/query-for-join/#comment-64171</link>
		<dc:creator>msi77</dc:creator>
		<pubDate>Wed, 03 Jun 2009 06:35:43 +0000</pubDate>
		<guid isPermaLink="false">#comment-64171</guid>
		<description><![CDATA[I think you need  to change the design of Rules table, so it is not in 1NF.
You&#039;ll have no issues with join if this table will be

id         unitid
1           A1
1           A2
2           A1
2           A3

PK={id, unitid}]]></description>
		<content:encoded><![CDATA[<p>I think you need  to change the design of Rules table, so it is not in 1NF.<br />
You&#8217;ll have no issues with join if this table will be</p>
<p>id         unitid<br />
1           A1<br />
1           A2<br />
2           A1<br />
2           A3</p>
<p>PK={id, unitid}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.041 seconds using memcached
Object Caching 297/298 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 07:34:54 -->