‎2007 Oct 29 6:11 AM
Hi All,
Please tell me how can i fetch a single record having maximum value for a particular column ( aggregate function MAX ).
assume that the table name = T1 and column name = C1
Thanks in Advance, Sudeep..
‎2007 Oct 29 6:14 AM
Select MAX(C1)
into var_c1
from T1
where <your condition>.
regards
Nishant
‎2007 Oct 29 6:14 AM
Select MAX(C1)
into var_c1
from T1
where <your condition>.
regards
Nishant
‎2007 Oct 29 6:23 AM
‎2007 Oct 29 6:18 AM
tables T1.
data tvbak like vbak-vbeln.
Select max( C1 )
from T1 into tvbak.
write tvbak.
‎2007 Oct 29 6:19 AM
data: it_table type T1.
SELECT single * FROM T1
INTO TABLE it_table
WHERE C1 = ( SELECT MAX( C1 ) FROM T1 ).
LOOP AT it_table.
WRITE: it_table-C1.
ENDLOOP.
Award points if found useful
‎2007 Oct 29 6:22 AM
Select MAX(C1)
into var_c1
from T1
where <your condition>
GROUP BY C1.
This will work..
Reward points if it helps