Thumb

Select Unique and Distinct statement

9/12/2020 7:51:17 AM

In the SQL Distinct is a keyword which is responsible for find the one value from duplicate values.   Distinct keyword dose not work in unique values like primary key. Now given bellow the Distinct keyword code and explain the code:

use [crud]
go
/*without condition*/
Select Distinct Name from  [dbo].[Teacher]

We can see the code using Distinct keyword on the Name field.