Single Select

In ABAP What is the difference between select single and select upto one row? Explain

Questions by sankaran.ramaiah   answers by sankaran.ramaiah

Showing Answers 1 - 4 of 4 Answers

nitla

  • Dec 28th, 2010
 

select single:

It fetches single record from the database, based on the condition you specified in the where clause

select upto:
Fetches first record if the condition specified in the where clause is satisfied, otherwise it doesn't fetch any record.

  Was this answer useful?  Yes

Select single * from table

It fetches single record from the database, based on the condition you specified in the where clause.

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

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 or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set.

Where as select * from table up to 1 row
Fetches first record if the condition specified in the where clause is satisfied, otherwise it doesn't fetch any record.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions