Wednesday, January 25, 2012

SQL Server :- DISTINCT Keyword


SQL DISTINCT
The SQL DISTINCT clause is used together with the SQL SELECT keyword, to return a dataset with unique entries for certain database table column.




For example if we want to select all distinct ReorderPoint from our Address table, we will use the following SQL DISTINCT statement:

SELECT DISTINCT LastName FROM Customers

Database: Adventure Works

Schema: Person

Table: Address

select distinct(ReorderPoint) from AdventureWorks.Production.Product
-or-
select distinct(ReorderPoint) from  Product

Like and Share to SQL Integrity Blog

No comments:

Post a Comment

Thank You !!!!