Use of distinct in sql server

By j Miracle

here i show you how the distinct key word used in sql server.

the word distinct is make the information of the field in the group.

we can understand it easily to se the example if the distinct.

select distinct <field name> from table name;


suppose there is data of database named "dept" as follow

     dept salary

salary 10,000
sales 11,000
salary 5,000
sales 7,000

select distinct dept,salary from dept;

output is:-

dept_name     salary

salary       15,000

sales       18,000

Use of distinct in sql server  (864 Views)