Article View: borland.public.interbase.sql
Article #653retrieve rows where one field is duplicated
From: RB Smissaert
Date: Tue, 23 Oct 2007 21:18
Date: Tue, 23 Oct 2007 21:18
20 lines
1568 bytes
1568 bytes
What would be the quickest way to retrieve all the rows from a table where one field has duplicates in another row? So for example if we want the rows where f1 has duplicates and the following table: f1 f2 -------- A 1 A 2 B 3 C 4 C 5 retrieve all the rows except the one with B and 3. I can do it with a subquery and group by and count > 1 but it is very slow. I am coming to think that this may be best done in code rather than in SQL, but maybe knows a way. RBS
Technical Details
Message-ID:
<471e654e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,2519d605a4e0cfb9,start X-Google-Attributes: gid114a0e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "RB Smissaert" <bartsmissaert@blueyonder.co.uk> Newsgroups: borland.public.interbase.sql Subject: retrieve rows where one field is duplicated Date: Tue, 23 Oct 2007 22:18:41 +0100 Lines: 23 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 82.37.28.137 Message-ID: <471e654e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1193174350 82.37.28.137 (23 Oct 2007 14:19:10 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail