<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic duplicate record sql in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159359#M902344</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;We have a 9i DB &amp;amp; would like to search for duplicate records on a specific column. Does anypne know&lt;BR /&gt;what the sql statement should look like? &lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
    <pubDate>Thu, 08 Jan 2004 07:08:15 GMT</pubDate>
    <dc:creator>Edgar_8</dc:creator>
    <dc:date>2004-01-08T07:08:15Z</dc:date>
    <item>
      <title>duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159359#M902344</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;We have a 9i DB &amp;amp; would like to search for duplicate records on a specific column. Does anypne know&lt;BR /&gt;what the sql statement should look like? &lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Thu, 08 Jan 2004 07:08:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159359#M902344</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2004-01-08T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159360#M902345</link>
      <description>select &lt;SPECIFIC column=""&gt; from &lt;TABLE&gt; where count(&lt;SPECIFIC column=""&gt;) &amp;gt; 1 group by &lt;SPECIFIC column=""&gt;&lt;BR /&gt;&lt;BR /&gt;This should do the trick. Of course this can be expanded to whatever you like, or used in a subselect.&lt;BR /&gt;&lt;/SPECIFIC&gt;&lt;/SPECIFIC&gt;&lt;/TABLE&gt;&lt;/SPECIFIC&gt;</description>
      <pubDate>Thu, 08 Jan 2004 07:29:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159360#M902345</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-08T07:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159361#M902346</link>
      <description>Sorry, I'm not sure it works in Oracle, but at least doesn't work in MySQL. You could change it to:&lt;BR /&gt;&lt;BR /&gt;create view cnt_view as select &lt;SPECIFIC&gt;,count(specific) cnt from &lt;TABLE&gt; group by &lt;SPECIFIC&gt;;&lt;BR /&gt;select * from cnt_view where cnt &amp;gt; 1;&lt;BR /&gt;&lt;BR /&gt;Or something like that.&lt;/SPECIFIC&gt;&lt;/TABLE&gt;&lt;/SPECIFIC&gt;</description>
      <pubDate>Thu, 08 Jan 2004 07:42:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159361#M902346</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-08T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159362#M902347</link>
      <description>Following will work in Oracle:&lt;BR /&gt;&lt;BR /&gt;select &lt;SPECIFIC column=""&gt; from &lt;TABLE&gt; &lt;BR /&gt;group by &lt;SPECIFIC column=""&gt;&lt;BR /&gt;having count(&lt;SPECIFIC column=""&gt;) &amp;gt; 1&lt;BR /&gt;&lt;BR /&gt;sks&lt;/SPECIFIC&gt;&lt;/SPECIFIC&gt;&lt;/TABLE&gt;&lt;/SPECIFIC&gt;</description>
      <pubDate>Thu, 08 Jan 2004 07:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159362#M902347</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-01-08T07:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159363#M902348</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;select col from table group by col having count(*) &amp;gt; 1;&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jan 2004 07:54:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159363#M902348</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-01-08T07:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159364#M902349</link>
      <description>This is one that I picked up from Metalink, that I just love for this:&lt;BR /&gt;&lt;BR /&gt;delete from tableA&lt;BR /&gt;where rowid in&lt;BR /&gt;(select rowid from tableA minus&lt;BR /&gt;select max(rowid) from table group by columnA)&lt;BR /&gt;&lt;BR /&gt;You will need to change tableA and columnA. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Thu, 08 Jan 2004 15:55:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159364#M902349</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2004-01-08T15:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159365#M902350</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Also, consider the following example:&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; create table t1 ( c1 int, c2 int, c3 char(1) );&lt;BR /&gt;&lt;BR /&gt;Table created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; insert into t1 values ( 1, 50, 'a' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; insert into t1 values ( 1, 50, 'b' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; insert into t1 values ( 2, 89, 'x' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; insert into t1 values ( 2, 89, 'y' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; insert into t1 values ( 2, 89, 'z' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; delete from T1&lt;BR /&gt;  2   where rowid &amp;lt;&amp;gt; ( select max(rowid)&lt;BR /&gt;  3                      from t1 b&lt;BR /&gt;  4                     where b.c1 = t1.c1&lt;BR /&gt;  5                       and b.c2 = t1.c2 )&lt;BR /&gt;  6  /&lt;BR /&gt;&lt;BR /&gt;3 rows deleted.&lt;BR /&gt;&lt;BR /&gt;yd@MYDB.MU&amp;gt; select * from t1;&lt;BR /&gt;&lt;BR /&gt;        C1         C2 C&lt;BR /&gt;---------- ---------- -&lt;BR /&gt;         1         50 b&lt;BR /&gt;         2         89 z&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I use it to delete duplicates. &lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Thu, 08 Jan 2004 23:54:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159365#M902350</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-01-08T23:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159366#M902351</link>
      <description>Hello Edqar&lt;BR /&gt;&lt;BR /&gt;Did the following work:&lt;BR /&gt;select &lt;SPECIFIC column=""&gt; from &lt;TABLE&gt; &lt;BR /&gt;group by &lt;SPECIFIC column=""&gt;&lt;BR /&gt;having count(&lt;SPECIFIC column=""&gt;) &amp;gt; 1&lt;BR /&gt;&lt;BR /&gt;One has to ensure that all columns given in group by must also be included in the select clause.&lt;BR /&gt;&lt;BR /&gt;Other columns can only be included in the select if they are used with grouping functions such as max, min, sum, count etc.&lt;BR /&gt;&lt;BR /&gt;sks&lt;/SPECIFIC&gt;&lt;/SPECIFIC&gt;&lt;/TABLE&gt;&lt;/SPECIFIC&gt;</description>
      <pubDate>Thu, 08 Jan 2004 23:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159366#M902351</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-01-08T23:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate record sql</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159367#M902352</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;since you gave only 5 or 6 points to the group &amp;amp; having statements (which are correct as I think), could it be, that you ar not looking for these Values, but the entire records ?&lt;BR /&gt;&lt;BR /&gt;Like this ?&lt;BR /&gt;&lt;BR /&gt;select * from table where specific_column&lt;BR /&gt;in &lt;BR /&gt;( &lt;BR /&gt;  select specific_column &lt;BR /&gt;  from table &lt;BR /&gt;  group by specific_column &lt;BR /&gt;   having count(*) &amp;gt; 1 )&lt;BR /&gt;order by specific_column;&lt;BR /&gt;&lt;BR /&gt;Do not know if this helps&lt;BR /&gt;Volker</description>
      <pubDate>Fri, 09 Jan 2004 15:03:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/duplicate-record-sql/m-p/3159367#M902352</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-01-09T15:03:49Z</dc:date>
    </item>
  </channel>
</rss>

