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

Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie : writing an efficient query

Re: newbie : writing an efficient query

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 04 Aug 2006 16:44:53 -0700
Message-ID: <1154735090.10892@bubbleator.drizzle.com>


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.org
Received on Fri Aug 04 2006 - 18:44:53 CDT

Original text of this message

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