 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; MERGE statement</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/merge-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Sun, 26 May 2013 01:32:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>STAR JOIN command in SPSS</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/star-join-command-in-spss/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/star-join-command-in-spss/#comments</comments>
		<pubDate>Mon, 17 Sep 2012 15:26:55 +0000</pubDate>
		<dc:creator>IRspecialist</dc:creator>
				<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[SPSS]]></category>
		<category><![CDATA[star join statement]]></category>
		<category><![CDATA[version 21]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/star-join-command-in-spss/</guid>
		<description><![CDATA[New Answer by TomLiotta]]></description>
				<content:encoded><![CDATA[New Answer by TomLiotta]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/star-join-command-in-spss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPSS v. 21 STAR JOIN</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/spss-v-21-star-join/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/spss-v-21-star-join/#comments</comments>
		<pubDate>Tue, 11 Sep 2012 17:25:42 +0000</pubDate>
		<dc:creator>IRspecialist</dc:creator>
				<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[star join statement]]></category>
		<category><![CDATA[version 21]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/spss-v-21-star-join/</guid>
		<description><![CDATA[New Discussion Post by IRspecialist]]></description>
				<content:encoded><![CDATA[New Discussion Post by IRspecialist]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/spss-v-21-star-join/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Merging Organizations in Oracle</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/merging-orgs/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/merging-orgs/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 07:34:56 +0000</pubDate>
		<dc:creator>Mavicc</dc:creator>
				<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle administration]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[New Discussion Post by]]></description>
				<content:encoded><![CDATA[New Discussion Post by ]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/merging-orgs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Merge two datasets in a DO loop</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/merge-two-datasets-in-a-do-loop/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/merge-two-datasets-in-a-do-loop/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 15:44:53 +0000</pubDate>
		<dc:creator>Brcmeric</dc:creator>
				<category><![CDATA[DO LOOP statement]]></category>
		<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[SAP Business Intelligence]]></category>
		<category><![CDATA[SAS]]></category>
		<category><![CDATA[SAS Business Intelligence software]]></category>
		<category><![CDATA[SAS Data Analysis]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have two datasets like this: data1 : store sales1 sales2&#8230;.sales52 1 2 3 . . 10 data2: Store sales1 sales2&#8230;..sales52  1 2 3 . . . 100   okay, now what I want is to take the first row of data1 merge it with data2, take the difference of sales between the observation from [...]]]></description>
				<content:encoded><![CDATA[<p>I have two datasets like this: <br/><br/> data1 :<br/><br/> store sales1 sales2&#8230;.sales52 <br/><br/> 1<br/><br/> 2<br/><br/> 3<br/><br/> .<br/><br/> .<br/><br/> 10<br/><br/> data2: <br/><br/> Store sales1 sales2&#8230;..sales52<br/><br/>  1 <br/><br/> 2 <br/><br/> 3 <br/><br/> . <br/><br/> . <br/><br/> . <br/><br/> 100 <br/><br/>  <br/><br/> okay, now what I want is to take the first row of data1 merge it with data2, take the difference of sales between the observation from data1 and all the rows of data2; <br/><br/> specifically I want sales1 (of the store from data1)-sales1(all other stores in data2) then sales2- sales2&#8230;., then I want to to print this out on a different dataset, <br/><br/> And the MOst important part is I want to do this step for every store in data1, seperately. Like after doing it for the first row of data1 I want to do the same for the second row of data1 and so on&#8230;<br/><br/>  So that at last if I have 10 stores in data1, I will have 10 different new datasets, showing the differences betwwen sales of each store from data1 and all the stores in data2. I would be glad if anyone can help me on this. Thanks!<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/merge-two-datasets-in-a-do-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use of multiple SET/WHERE clauses in the MERGE of 2 Oracle tables</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/use-of-multiple-setwhere-clauses-in-the-merge-of-2-oracle-tables/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/use-of-multiple-setwhere-clauses-in-the-merge-of-2-oracle-tables/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 15:49:22 +0000</pubDate>
		<dc:creator>Ejpeth</dc:creator>
				<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[Oracle Table]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[SET/WHERE]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Currently am able to update 1 Oracle table from another using MERGE along with WHEN MATCHED THEN UPDATE logic. Under the UPDATE command I am using a SET/WHERE to update a specific column based on certain criteria. I want to add another SET/WHERE condition to this same update which will result in an UPDATE of [...]]]></description>
				<content:encoded><![CDATA[<p>Currently am able to update 1 Oracle table from another using MERGE along with WHEN MATCHED THEN UPDATE logic. Under the UPDATE command I am using a SET/WHERE to update a specific column based on certain criteria.  I want to add another SET/WHERE condition to this same update which will result in an UPDATE of a diff column if a diff condition (WHERE) is met.<br />
Below I have pasted an example of the code which is working, as well as the modified code which I am unable to run successfully.  It appears 2 SET/WHERE conditions under the same UPDATE won&#8217;t work &#8230; or I have not syntactically coded this correctly. Thanks for any help you can provide:</p>
<p>== code below is working just fine  ==<br />
MERGE INTO mbs_daterange md<br />
USING ( SELECT * FROM cmo_keyvals ) ck<br />
ON    (md.seqno = ck.seqno AND md.item = ck.item)<br />
WHEN MATCHED THEN<br />
    UPDATE<br />
    SET md.end_range = ck.end_range<br />
    WHERE ck.end_range &gt; md.end_range<br />
WHEN NOT MATCHED THEN INSERT<br />
   (md.seqno, md.item, md.begin_range, md.end_range, md.location)<br />
    VALUES (ck.seqno, ck.item, ck.end_range, ck.end_range, NULL);<br />
commit;</p>
<p>== modified code below does not work ==</p>
<p>MERGE INTO mbs_daterange md<br />
USING ( SELECT * FROM cmo_keyvals ) ck<br />
ON    (md.seqno = ck.seqno AND md.item = ck.item)<br />
WHEN MATCHED THEN<br />
    UPDATE<br />
    SET md.end_range = ck.end_range<br />
    WHERE ck.end_range &gt; md.end_range<br />
    SET md.begin_range = ck.end_range<br />
    WHERE ck.end_range &lt; md.begin_range<br />
WHEN NOT MATCHED THEN INSERT<br />
   (md.seqno, md.item, md.begin_range, md.end_range, md.location)<br />
    VALUES (ck.seqno, ck.item, ck.end_range, ck.end_range, NULL);<br />
commit;</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/use-of-multiple-setwhere-clauses-in-the-merge-of-2-oracle-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SORT/MERGE</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sortmerge/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sortmerge/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 07:06:35 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[COBOL/400]]></category>
		<category><![CDATA[MERGE statement]]></category>
		<category><![CDATA[SORT statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hello, Can anyone, provide sample programs for SORT/MERGE statements in COBOL/400?]]></description>
				<content:encoded><![CDATA[<p>Hello,</p>
<p>Can anyone, provide sample programs for SORT/MERGE statements in COBOL/400?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sortmerge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</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/20 queries in 0.025 seconds using memcached
Object Caching 648/712 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-26 04:26:17 -->