HI,
count
TABLES SPFLI. DATA COUNT TYPE I. SELECT COUNT( DISTINCT CARRID ) INTO COUNT FROM SPFLI WHERE CITYTO = 'NEW YORK'. WRITE: / COUNT.
sum
TABLES SBOOK. DATA: SUM TYPE P DECIMALS 2. DATA: CONNID LIKE SBOOK-CONNID. SELECT SUM( LUGGWEIGHT ) INTO SUM FROM SBOOK WHERE CARRID = 'LH ' GROUP BY CONNID. WRITE: / SUM. ENDSELECT.
rgds,
bharat.
Hi Naveen Inuganti ,
Check the following statements.
tables scustom. data row_count type i. select count(*) from scustom into row_count. write: / 'The SCUSTOM table has', row_count, 'rows'.
Calculates the number of rows in a table and puts the total into a data object.
tables sbook. data: count type i, sum type p decimals 2, avg like sum, connid like sbook-connid. select connid count(*) sum( luggweight ) avg( luggweight ) into (connid, count, sum, avg) from sbook where carrid = 'LH' and fldate = '20010228' group by connid. write: / connid, count, sum, avg. endselect.
Outputs the number of passengers, the total weight and the average weight of luggage for all Lufthansa flights on 28.02.2001
Hope its useful.
Reward points if useful.
Thanks ,
Surya Pydikondala
Add a comment