<?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: How to assign the same number identifier to different groups that contain the identical set of data in a SQL statement</title>
	<atom:link href="http://oraqa.com/2007/05/24/how-to-assign-the-same-number-identifier-to-different-groups-that-contain-the-identical-set-of-data-in-a-sql-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://oraqa.com/2007/05/24/how-to-assign-the-same-number-identifier-to-different-groups-that-contain-the-identical-set-of-data-in-a-sql-statement/</link>
	<description>Oracle Question and Answer</description>
	<lastBuildDate>Tue, 06 Jul 2010 14:28:12 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: newkid</title>
		<link>http://oraqa.com/2007/05/24/how-to-assign-the-same-number-identifier-to-different-groups-that-contain-the-identical-set-of-data-in-a-sql-statement/comment-page-1/#comment-293</link>
		<dc:creator>newkid</dc:creator>
		<pubDate>Thu, 01 Jul 2010 21:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2007/05/24/how-to-assign-the-same-number-identifier-to-different-groups-that-contain-the-identical-set-of-data-in-a-sql-statement/#comment-293</guid>
		<description>&lt;PRE&gt;
SELECT date_time, validity, DENSE_RANK() OVER(ORDER BY elements) AS id
  FROM (SELECT date_time, validity, MAX(path) OVER(PARTITION BY date_time) elements
          FROM (SELECT t.*,SYS_CONNECT_BY_PATH(validity,&#039;/&#039;) path
                  FROM (SELECT test.*,ROW_NUMBER() OVER(PARTITION BY date_time ORDER BY validity) rn
                          FROM test
                          ) t
                START WITH rn=1 CONNECT BY date_time = PRIOR date_time AND rn = PRIOR rn+1
                )
)

11GR2:
SELECT date_time, validity, DENSE_RANK() OVER(ORDER BY elements) AS id
  FROM (SELECT test.*,LISTAGG(validity,&#039;,&#039;) WITHIN GROUP (ORDER BY validity) OVER(PARTITION BY date_time) elements
          FROM test
        );
&lt;/PRE&gt;</description>
		<content:encoded><![CDATA[<pre>
SELECT date_time, validity, DENSE_RANK() OVER(ORDER BY elements) AS id
  FROM (SELECT date_time, validity, MAX(path) OVER(PARTITION BY date_time) elements
          FROM (SELECT t.*,SYS_CONNECT_BY_PATH(validity,&#8217;/') path
                  FROM (SELECT test.*,ROW_NUMBER() OVER(PARTITION BY date_time ORDER BY validity) rn
                          FROM test
                          ) t
                START WITH rn=1 CONNECT BY date_time = PRIOR date_time AND rn = PRIOR rn+1
                )
)

11GR2:
SELECT date_time, validity, DENSE_RANK() OVER(ORDER BY elements) AS id
  FROM (SELECT test.*,LISTAGG(validity,&#8217;,') WITHIN GROUP (ORDER BY validity) OVER(PARTITION BY date_time) elements
          FROM test
        );
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
