‎2007 Apr 07 3:22 AM
hi,
what is the difference for select single and select distinct?
thanks
‎2007 Apr 07 3:37 AM
Hi,
This is the difference between these two
<b>SELECT SINGLE</b>
<b>The result of the selection should be a single entry</b>. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
<b>SELECT DISTINCT</b>
Duplicate entries in the result set are automatically deleted. There can be multiple entry exist in database for WHERE condition.
Let me know if you need any other information.
Regards,
RS
‎2007 Apr 07 3:37 AM
Hi,
This is the difference between these two
<b>SELECT SINGLE</b>
<b>The result of the selection should be a single entry</b>. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
<b>SELECT DISTINCT</b>
Duplicate entries in the result set are automatically deleted. There can be multiple entry exist in database for WHERE condition.
Let me know if you need any other information.
Regards,
RS
‎2007 Apr 07 3:52 AM
select single statement is used to retrieve a single record by inputting all the combination of primary key as the search criteria. Here we retrieve a single unique record.
select distinct is used to retrieve a set of records satisfying the search criteria without any duplicate records. here you may not need to give the combination of primary key as search criteria.
‎2007 Apr 07 4:51 AM
Hi,
Please reward appropriate point and close the thread. It is a way to say thanks in forum.
Regards,
RS