RE: SQL to retrieve all distinct records

  • From: "Niall Litchfield" <n-litchfield@xxxxxxxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 15 Apr 2004 15:03:10 +0100

How are you throwing away  SYS SYS2 R3 ?=20

Niall Litchfield
Oracle DBA
Audit Commission
+44 117 975 7805=20

> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx=20
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Alison Barak
> Sent: 15 April 2004 14:38
> To: oracle-l@xxxxxxxxxxxxx
> Subject: SQL to retrieve all distinct records
>=20
>=20
> Hi,
> can someone assist me with formulating a query to retrieve=20
> all distinct=20
> records. I need to retrieve all three columns a,b &c  based=20
> on the distinct=20
> of the two columns a & b.
>=20
> SQL> select * from testing;
> A          B          C
> ---------- ---------- ----------
> APPS       APPS       R1
> SYS        SYS2       R2
> SYS        SYS2       R3
> DOC        DOC2       R4
> DC         DC2        R5
> DOC        DOC        R6
>=20
> The result should be
> A          B          C
> ---------- ---------- ----------
> APPS       APPS       R1
> SYS        SYS2       R2
> DOC        DOC2       R4
> DC         DC2        R5
> DOC        DOC        R6
>=20
>=20
> I tried using group by/having count but was not successful. Any idea?
>=20
> Thanks.
>=20
> alison
>=20
> _________________________________________________________________
> MSN Toolbar provides one-click access to Hotmail from any Web=20
> page - FREE=20
> download! http://toolbar.msn.com/go/onm00200413ave/direct/01/
>=20
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
> put 'unsubscribe' in the subject line.
> --
> Archives are at //www.freelists.org/archives/oracle-l/
> FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>=20


**********************************************************************
This email contains information intended for
the addressee only.  It may be confidential
and may be the subject of legal and/or
professional privilege.  Any dissemination,
distribution, copyright or use of this
communication without prior permission of
the sender is strictly prohibited.
**********************************************************************

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: