What is the diffrence between select single * and Select
upto 1 row?

Answer Posted / ad

The SELECT SINGLE statement selects the first record in the
database table depending on the condition mentioned in the
WHERE clause. Only the first record is returned and may not
be unique. ENDSELECT keyword is not needed here.

But for the case of SELECT UPTO 1 ROW, all relevant records
are being selected depending on the WHERE clause. Then any
aggregate or grouping or ordering condition is applied to
them and only the 1st record from the resultant set is
being returned. ENDSELECT is must here.

SELECT SINGLE should be used for selecting with full
primary key combination but SELECT UP TO 1 ROWS is the
special case of SELECT UP TO n ROWS and can be used with
any WHERE condition.

As regarding the speed or performance it depends on various
conditions. If your database table contains several
entries, then SELECT UPTO 1 ROWS might take a longer time
to fetch and order all relevant records. But for limited
entries check for full primary key combination takes more
time in case of SELECT SINGLE. If you donot provide all
primary keys in SELECT SINGLE you will get message during
extended syntax check (SLIN).

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two statements which are required in an abap program to output an icon using a write statement?

990


What is internal payroll process? : sap abap hr

800


What is the tcode to create indexes?

786


What is the use of dequeue function module? : sap abap data dictionary

849


Explain lsmw?

826


What is the use of a pretty printer?

877


Can i Have Some Examples on Enhancements.

2205


How can I get ascii value of any letter? Is there any function?

882


how to Implement a BADI in which it restricts the access when purchase order is created against contract using definition ME_PURCHDOC_POSTED. please tell me the answers if any one knows. thanks in advance. :ravikiran

2258


Which function module reads the data for particular infotype ? : abap hr

754


What are the difference between tables and structures?

861


Explain what is the difference between sy-tabix and sy-index? Where it is used?

758


Which infotype records can not be deleted ? : abap hr

821


What is the last entry in all bdc tables? : abap bdc

776


how can we enable hyperlink in screen painter?

3640