Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL Plus Help
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 ALADD3ALADDZ
----------------------------------------
----------------------------------------
ALADD4 ALCTY1 ALA
121 101298 120 BROADWAY NEW YORK NY10271
121 102086 120 BROADWAY NEW YORK NY10005
121 102127 120 BROADWAY NEW YORK NY10271
121 102357 200 LIBERTY ST 22FLR 1 WORLD FINANCIAL CENTER NEW YORK NY10281
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
![]() |
![]() |