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: SQL Query question

Re: SQL Query question

From: Tommy Hagström <tomhag_at_rsv.se>
Date: Fri, 5 Jun 1998 12:43:32 +0200
Message-ID: <Pine.HPP.3.95.980605123447.23235D-100000@u30040.rsv.svskt.se>


On Wed, 3 Jun 1998, Bob McConnell wrote:

> Actually I'm trying to retrieve the complete records which contain
> several other fields. So what I'm trying to accomplish is
> select MAX(taskno),id, otherfield1,otherfield2,etc.
>
> How do I get by "NOT A SINGLE GROUP GROUP FUNCTION"
> error for the other fields I need?
>

Try this one:

    select taskno, id, otherfield1, otherfield2 etc

      from table1
     where taskno||id in
          (select max(taskno)||id
             from table1
            group by id)


Tommy

Email: tomhag_at_rsv.se Received on Fri Jun 05 1998 - 05:43:32 CDT

Original text of this message

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