BlindCat BlindCat - 3 months ago 8
SQL Question

Alternate way of this Query?

Let's say we have a Table named Employee with column 'Name':

+---------+
| Name |
+---------+
| Jack |
+---------+
| Paul |
+---------+
| Jack |
+---------+


To have the distinct name we can run this query:

Select DISTINCT Name
from Employee


Is there any other way to retrieve the distinct value?

Answer
Select Name 
from Employee
Group by Name

This also gives same result

Comments