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 |
How is batch input process different from processing online?
what is the standard program to check the consistency of the partner profiles?
BDC Data which format?
What are Change header/detail tables? Have you used them?
What is the different between template and a table?
which table contains the details of all Tcodes?
How can I get the default values (like date, company code) in module pool programming before the screen is displayed?? I dont wanna use VARIENTS...
What is the difference between leave transaction and call transaction?
What are the 3 methods that we use in sequence in a batch input session method? : abap bdc
What actually happens in real-time recruitment? : sap abap hr
What is your approach for writing a bdc program? : abap bdc
HI GUYS , FOR SAP INSTITUTION ATOS I BEST OR NOT? IAM PLANNING TO LEARN SAP COURSE IN ATOS... GIVE ME UR SUGGESTION ABOT ATOS?
SAP Basis (1262)
SAP ABAP (3939)
SAPScript (236)
SAP SD (Sales & Distribution) (2717)
SAP MM (Material Management) (912)
SAP QM (Quality Management) (99)
SAP PP (Production Planning) (523)
SAP PM (Plant Maintenance) (252)
SAP PS (Project Systems) (138)
SAP FI-CO (Financial Accounting & Controlling) (2766)
SAP HR (Human Resource Management) (1180)
SAP CRM (Customer Relationship Management) (432)
SAP SRM (Supplier Relationship Management) (132)
SAP APO (Advanced Planner Optimizer) (92)
SAP BW (Business Warehouse) (896)
SAP Business Workflow (72)
SAP Security (597)
SAP Interfaces (74)
SAP Netweaver (282)
SAP ALE IDocs (163)
SAP Business One (110)
SAP BO BOBJ (Business Objects) (388)
SAP CPS (Central Process Scheduling) (14)
SAP GTS (Global Trade Services) (21)
SAP Hybris (132)
SAP HANA (700)
SAP PI (Process Integration) (113)
SAP PO (Process Orchestration) (25)
SAP BI (Business Intelligence) (174)
SAP BPC (Business Planning and Consolidation) (38)
SAP BODS (Business Objects Data Services) (49)
SAP BODI (Business Objects Data Integrator) (26)
SAP Ariba (9)
SAP Fiori (45)
SAP EWM (Extended Warehouse Management) (58)
Sap R/3 (150)
SAP FSCM Financial Supply Chain Management (101)
SAP WM (Warehouse Management) (31)
SAP GRC (Governance Risk and Compliance) (64)
SAP MDM (Master Data Management) (0)
SAP MRS (Multi Resource Scheduling) (0)
SAP ESS MSS (Employee Manager Self Service) (13)
SAP CS (Customer Service) (0)
SAP TRM (Treasury and Risk Management) (0)
SAP Web Dynpro ABAP (198)
SAP IBP (Integrated Business Planning) (0)
SAP OO-ABAP (Object Oriented ABAP) (70)
SAP S/4 HANA Finance (Simple Finance) (143)
SAP FS-CD (Collections and Disbursements) (0)
SAP PLM (Product Lifecycle Management) (0)
SAP SuccessFactors (33)
SAP Vistex (0)
SAP ISR (IS Retail) (28)
SAP IdM (Identity Management) (0)
SAP IM (Investment Management) (0)
SAP UI5 (59)
SAP SCM (Supply Chain Management) (51)
SAP XI (Exchange Infrastructure) (49)
SAP Cloud Platform (34)
SAP Testing (89)
SAP SolMan (Solution Manager) (63)
SAP MaxDB (116)
SAP GUI (15)
SAP AllOther (329)