Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

pls explain this steps

Former Member
0 Likes
563

SELECT SINGLE SUM( seatsocc )

FROM sflight INTO sum

WHERE fldate LIKE '2001%'.

WRITE: / sum.

just explain what is being done in this program thankyou ....

3 REPLIES 3
Read only

Former Member
0 Likes
546

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

Read only

0 Likes
546

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

Read only

0 Likes
546

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.