‎2007 Oct 23 3:59 PM
SELECT SINGLE SUM( seatsocc )
FROM sflight INTO sum
WHERE fldate LIKE '2001%'.
WRITE: / sum.
just explain what is being done in this program thankyou ....
‎2007 Oct 23 5:29 PM
it is not really a performance topic, but absolute basic ABAP.
It selects from the table sflight all flightdates starting with 2001 and
sums up the seatoccupation.
The SINGLE is not necessary (maybe not even correct).
Siegfried
‎2007 Oct 24 5:12 AM
yes i know its basic ....i was reading abt how not to use select statement ...it came in this so i happen to ask a doubt....any way thanks for your help...
santo
‎2007 Oct 24 11:04 PM
SELECT SINGLE SUM( seatsocc )
FROM sflight INTO sum
WHERE fldate LIKE '2001%'.
WRITE: / sum.
Santosh,
Performance-wise, in this SQL statement, instead of using the LIKE operator, it would be faster to use BETWEEN '20010101' and '20011231'. The LIKE operator, although is robust enough for pattern matching, is generally DB intensive when you use it for non-character type data, like Date, Time, etc. As you can see, in this case the field FLDATE will be a limitation for using the LIKE operator.
Also as the previous suggestion goes, there is a logical bug in using the SINGLE addition to the SQL.
Thanks,
Chaps.