cancel
Showing results for 
Search instead for 
Did you mean: 

select fields in the max record

Former Member
0 Kudos
58

hi,

may i know how to select aggregate field1 and other fields in the same record where field1 is max?

this statement is incorrect. may i know what is the correct syntax?

thanks

select max( field1 ) field2 into (v_field1 , v_field2) from table where

fieldx = wa_inputrec-fieldx and

fieldy = wa_inputrec-fieldy.

Accepted Solutions (0)

Answers (2)

Answers (2)

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


select sum(field1) field2 into (v_field1 , v_field2) from table where
fieldx = wa_inputrec-fieldx and
fieldy = wa_inputrec-fieldy. 

Regards,

Ferry Lianto

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


select sum(field1) field2 into (v_field1 , v_field2) from table where
fieldx = wa_inputrec-fieldx and
fieldy = wa_inputrec-fieldy. 

Regards,

Ferry Lianto

Former Member
0 Kudos

hi,

i am using max, not sum.

with the same syntax, i still got error.