Re: New to SQL

From: Ken Denny <kdenny_at_mail.concentric.net>
Date: 1995/12/13
Message-ID: <4al5m3$r2v_at_spectator.cris.com>#1/1


Ken Denny <kdenny_at_mail.concentric.net> wrote:
> Instead you might try:
>
> select distinct name from customer where customerid in (select distinct customerid
> from orders where rownum<=6000 order by totalamount desc);
>
>I haven't tried this but I think it should work.

Well I tried it and it didn't work. Sorry. Actually Richard's solution is the way to do it, just add the word "distinct" to your select and you will eliminate duplicate customers. It turns out that Oracle won't allow you to use "order by" in a subquery. When I tried a statement similar to the one above it told me that it expected a right parenthesis before the word "order".

Sorry I took so long to get back.

Ken "still a newbie" Denny

If my employer had any opinions they would almost certainly be different from mine. If any opinions were expressed they are mine alone. Received on Wed Dec 13 1995 - 00:00:00 CET

Original text of this message