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

Difference between select single & select upto 1 row

Former Member
0 Likes
568

Hi,

what is the Difference between select single & select upto 1 row?

Whose performance is better?

Regards,

Mayank

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

When u have all key fields in WHERE use select single.

And when all key fields are not there in WHERE use SELECT ENDSELECT. in this case SELECT ENDSELECT performance is better.

4 REPLIES 4
Read only

Former Member
0 Likes
551

When u have all key fields in WHERE use select single.

And when all key fields are not there in WHERE use SELECT ENDSELECT. in this case SELECT ENDSELECT performance is better.

Read only

Former Member
Read only

Former Member
0 Likes
550

Hi

According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.

The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.

Mainly: to read data from

The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.

Read only

Former Member
0 Likes
550

According to the perfromance point fo view select single is the best because select single will directly fetch the data base by point out....where as select upto will need to be in loop...more iterations shopuld be required...

but one thing should be keep in mind..when we are usiong for a table ...in the table if all the primary fields are selected then only go to the select single other wise go for select upto 1 row.

Reward points if useful...

From

Love