‎2008 Jun 10 2:54 PM
Hi all,
i want to the exact difference between select and select single.can any one give me clarification on this.
thanks
hyma
‎2008 Jun 11 6:14 AM
<completely_removed_by_moderator>
Rgds,
Rajyalakshmi.
Edited by: Julius Bussche on Aug 20, 2008 10:07 PM
‎2008 Jun 10 3:03 PM
Hi
SELECT SINGLE is to extract only one record: so if u want to be sure to extract the right record u should use only the key fields in WHERE conditions, else the SELECT SINGLE returns the first one found.
SELECT SINGLE * FROM <table> WHERE <condition>.
SELECT is to extract all records satisfating a certain condition, so SELECT is cycle and it needs to be closed by ENDSELECT.
SELECT * FROM <table> WHERE <condition>.
ENDSELECT.
It can obtain something as SELECT SINGLE using SELECT/ENDSELCT statament with the option UP TO 1 ROWS or EXIT:
SELECT * UP TO 1 ROWS FROM <table> WHERE <condition>.
ENDSELECT.
SELECT * FROM <table> WHERE <condition>.
EXIT.
ENDSELECT.
Max
‎2008 Jun 10 3:14 PM
Select : fetches all the records from the database table satsifying the where condition
Select single : fetches only one record from the database table eventhough the specified where condition matches many records
Hope this helps U
‎2008 Jun 11 6:14 AM
<completely_removed_by_moderator>
Rgds,
Rajyalakshmi.
Edited by: Julius Bussche on Aug 20, 2008 10:07 PM
‎2008 Jun 11 6:53 AM
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.
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.
‎2008 Jun 11 8:06 AM