sql
SQL SELECT DISTINCT Statement
.
SQL- SELECT DISTINCT
Distinct means different, In Sql distinct (different) query is used to avoid the duplicate value. A table may contain duplicate value if you wants only distinct value then use the DISTINCT Statement.
SQL- SELECT DISTINCT Syntax
The basic syntax for the SELECT DISTINCT is as follows
SELECT DISTINCT Columnname FROM TableName;
Note: SQL SELECT DISTINCT can be used with COUNT.
SELECT COUNT (DISTINCT Columnname) FROM TableName;
SQL SELECT DISTINCT EXAMPLE-
SELECT DISTINCT StudentName FROM Student ;
In Above Example It Will Select all the Distinct value from studentname column in the student table.
SELECT COUNT (DISTINCT StudentName) FROM Student;
.
Post a Comment
0 Comments