Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL to retrieve all distinct records

RE: SQL to retrieve all distinct records

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 15 Apr 2004 15:03:10 +0100
Message-ID: <CFECD6EA683C524BB5FD22C0F1F34ACB011F375B@bristol43.audit-commission.gov.uk>


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_at_freelists.org=20
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Alison Barak
> Sent: 15 April 2004 14:38
> To: oracle-l_at_freelists.org
> 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_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://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_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Thu Apr 15 2004 - 09:27:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US