Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie : writing an efficient query
dn.perl_at_gmail.com wrote:
> One more point which I have been curious about .
> Why doesn't 'distinct' work on composite fields?
>
> Table t1 : a1 number, a2 number.
> Entries : (1,11) (2,21), (2,22) (2,22) (2,23) (2,23)
> (3,33) (3, 33)
>
> select distinct(a1, a2) from t1 ... does not work.
> How do I write that query?
Do yo see a problem here?
SQL> select a1, a2 from t1;
A1 A2
---------- ----------
1 11 2 21 2 22 2 22 2 23 3 33 3 33
7 rows selected.
SQL> select distinct a1, a2 from t1;
A1 A2
---------- ----------
3 33 2 21 2 23 1 11 2 22
I don't.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Fri Aug 04 2006 - 18:44:53 CDT
![]() |
![]() |