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.
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.
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.
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.
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.