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 -> SQL Plus Help

SQL Plus Help

From: Ash <ashok_settyvari_at_yahoo.com>
Date: 10 Jun 2004 14:38:50 -0700
Message-ID: <e7f2e36f.0406101338.5f8ca7d8@posting.google.com>


Hello:

Im a newbee to SQL. Here is an SQL statement and its result.   1* select ALAN8,ALEFTB,ALADD1,ALADD2,ALADD3,ALADD4,ALCTY1,ALADDS,ALADDZ from F0116,F0101 where ABAN8=ALAN8 AND abat1='C' and aban8='121' SQL> /     ALAN8 ALEFTB ALADD1

--------- --------- ----------------------------------------
ALADD2                                   ALADD3

----------------------------------------
----------------------------------------
ALADD4 ALCTY1 ALA
ALADDZ
---------------------------------------- ------------------------- ---

      121    101298
                                         120 BROADWAY
                                         NEW YORK                  NY 
10271
      121    102086
                                         120 BROADWAY
                                         NEW YORK                  NY 
10005
      121    102127
                                         120 BROADWAY
                                         NEW YORK                  NY 
10271
      121    102357
200 LIBERTY ST 22FLR                     1 WORLD FINANCIAL CENTER
                                         NEW YORK                  NY 
10281

The thing, Im trying to get now is get the max value of aleftb column with a similar SQL statement. something like

1* select ALAN8,max(ALEFTB),ALADD1,ALADD2,ALADD3,ALADD4,ALCTY1,ALADDS,ALADDZ from F0116,F0101 where ABAN8=ALAN8 AND abat1='C' and aban8='121'

When I use this, its giving me not a GROUP BY expression. Then I tried grouping the above statement like this.

1* select ALAN8,max(ALEFTB),ALADD1,ALADD2,ALADD3,ALADD4,ALCTY1,ALADDS,ALADDZ from F0116,F0101 where ABAN8=ALAN8 AND abat1='C' and aban8='121' group by alan8,aleftb;

Again its giving me the same result, not a GROUP BY function.

Can anyone please let me know, what all the columns I need to include in group by expression.

Thanks a ton.

Ash Received on Thu Jun 10 2004 - 16:38:50 CDT

Original text of this message

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