|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
SQL UNIQUE and DISTINCT Hello Friends, I recently started to learn the SQL. I have some confusion about UNIQUE and DISTINCT clause of SQL. I am not getting what is the exact use of these UNIQUE and DISTINCT clause. I have have referred many books but nothing was helpful. If you posses sound knowledge about the UNIQUE and DISTINCT clause, then please try to share it me. I will really appreciate your any help. |
#2
| |||
| |||
Re: SQL UNIQUE and DISTINCT The SQL DISTINCT clause is basically used beside with SELECT keyword and that retrieve only unique data entry depending on the column list you have mentioned after it. Fundamentally what the DISTINCT keyword does is removing the duplicate from the consequence set returned by SELECT statement. |
#3
| |||
| |||
Re: SQL UNIQUE and DISTINCT I don't found any dissimilarity in with distinct and unique in the select statement, as both clause are performing same procedure in the select. I want to add one that is u can not use distinct clause in the create statement while unique clause u can. I suggest you to practically try these two clause, and see what result you will get. |
#4
| |||
| |||
Re: SQL UNIQUE and DISTINCT According to me the difference between distinct and unique is, unique is apply previous to insertion and retrieval. It comprises of non replica values. If unique constraint is specified it doesn?t obtain replica values. The distinct is useful in retrieval, consequently distinct is the grouping of concealed duplicate and non duplicate rows. |
#5
| |||
| |||
Re: SQL UNIQUE and DISTINCT When you apply unique clause all the column values will be sorted. But it is different in distinct clause, it only confiscate the duplicate from the sql table, not column values which are sorted. The unique is nothing but the constraint it's assert for to prevent the data duplication. I hope it will resolve all your confusion about unique clause. |
#6
| |||
| |||
Re: SQL UNIQUE and DISTINCT The SQL DISTINCT command is normally used with the SELECT statement of sql that retrieves only distinctive data entry depending on the column list that you have precise after it. Basically what the DISTINCT clause does is removing the duplicate which is from the result set returned by SELECT statement. |
![]() |
|
Tags: distinct, sql, sql clause, unique |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Select unique values without using distinct | Maya Angelou | Software Development | 6 | 17-05-2010 10:26 AM |
What is the difference between Distinct and DistinctRow? | Orion lella | Software Development | 4 | 04-02-2010 01:29 AM |
How to use DISTINCT in SQL | DotNetUser | Software Development | 2 | 07-09-2009 11:33 PM |
Distinct OR Group By | sidkid | Windows Software | 3 | 03-09-2009 08:36 PM |
SELECT UNIQUE and SELECT DISTINCT | TAARIQ | Software Development | 3 | 03-06-2009 10:00 PM |