What is the diffrence between select single * and Select
upto 1 row?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kiran kumar v
Select Single * -- 1) Will never have endselect.2)
Applicable key fields are mentioned in Where clause.3) It
retrieves the first record which matches the condition.
Select upto 1 row -- 1) Will have endselect. 2)Where clause
is not mandatory. 3) Pull up all the records and display
the first record in the list.
Is This Answer Correct ? | 9 Yes | 3 No |
Answer / m raj
If i know the answer, i would have got the better job.
Is This Answer Correct ? | 17 Yes | 13 No |
Answer / chitta ranjan mahato
I am agree with the above answers given but I am to add
few lines.
Select Single can give you best performace when it is fired
with full primary key.
Select up to 1 rows is a special case of select up to n
rows.
there is almost no difference in performace in small
database. select single is used to check the avaviility of
particular record in database.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / chittidi
select single f1 f2 f3 ... into <wa> from <dbtab> where
<condition>. this where condition is important to fetch
exact record from database . for thsi purpose we provide
entire primary key combination in whrere conditon.
by using this statement to read exact information .
select f1 f2 f3 .... into <wa> from <dbtab> up to 1 rows
where <condition>
endselect.
it reads the first record found which may not be exact .
the where condition can be part of primary key combination.
it is mainly used to validate the INPUT.
IF WE ARE NOT PASSING ENTIRE COMBINATION OF PRIMARY KEY
IN SELET * SINGLE IT SIMPLY ACTS AS SELECT * UP TO 1 ROWS.
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / kapil goyal
Select single fetches first matching record. If more than one matching records are there then only the first matching record will be considered other records will not be taken into account. Where as select up to 1 rows will fetch all the matching records from the database.(Again it will assign only One Record to the internal table/Work area)
Is This Answer Correct ? | 1 Yes | 0 No |
tell me ddic objects
with out doing any action how to go another screen ,means when ever control comes to that particular field this action has to be done?
2 Answers Bristle Cone, Cap Gemini, HP, Satyam, Wipro,
how to create module pool program using table controls based on selection criteria specified for sales document item in the first screen and item details in the second screen. plz mention the detail coding Tahnks, Rahul
if data is inserted only using bdc open and bdc insert and not bdc close session funx module wat will happend? will data b inserted?
Explain what is an rdbms?
what is the use of SLIS type pool in alv reports?
how to debug user exits?
What is the maximum number of structures that can be included in a table or structure
How can you call a subroutine which is located in program A from program B?
How will you define org structure in MM?
Hi Friends, I want to learn sap sd module as it has to be learn to get job in sap platform. I have seen many institution not imparting training as it has to be impart. I want to learn SD Module with running Business Scenario CIN (Country Version India) Realtime Projects (implementation & Support) I want sap realtime data for reference, practice Please help me out
What is the significance of delivery class ? : sap abap data dictionary