Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL Plus Help
Hello,
Im trying to use SQL Plus on 2 tables in Oracle database. The code is as follows.
select ALAN8,ALEFTB,ALADD1,ALADD2,ALADD3,ALADD4,ALCTY1,ALADDS,ALADDZ from F0116,F0101 where ABAN8=ALAN8 AND abat1='C' and ALAN8=55
When I execute the above the result is as follows.
ALAN8 ALEFTB ALADD1
--------- --------- ---------------------------------------- ALADD2 ALADD3ALADDZ
----------------------------------------
----------------------------------------
ALADD4 ALCTY1 ALA
55 101298 ATTN: ANTIONETTE ROMAN 2ND FLOOR 570 WASHINGTON ST NEW YORK NY10080
55 102077 ATTN: ANTIONETTE ROMAN 2ND FLOOR 570 WASHINGTON ST NEW YORK NY10014
55 102157 ATTN: SHIRLEY LEH 2ND FLOOR 570 WASHINGTON ST NEW YORK NY10014
55 103022 ATTN: SHIRLEY LEH 2ND FLOOR 570 WASHINGTON ST NEW YORK NY10014
55 103031 ATTN: SHIRLEY LEH ALAN8 ALEFTB ALADD1
--------- --------- ---------------------------------------- ALADD2 ALADD3ALADDZ
----------------------------------------
----------------------------------------
ALADD4 ALCTY1 ALA
2ND FLOOR 570 WASHINGTON ST NEW YORK NY10014
Now, what I wanted to acheive is, Im getting multiple records from the table F0116 which are matching the criteria. Out of these records, I wanted to get the record where the column ALEFTB is maximum. So I tried using the following code.
select ALAN8,MAX(ALEFTB),ALADD1,ALADD2,ALADD3,ALADD4,ALCTY1,ALADDS,ALADDZ from F0116,F0101 where ABAN8=ALAN8 AND abat1='C' and ALAN8=55;
When I executed the above code, Im getting error not a single-group group function.
Can anyone please help me to acheive this.
Thanks
Ash Received on Thu Mar 18 2004 - 09:51:52 CST
![]() |
![]() |