Differences between UNIQUE and DISTINCT in select statements
Answer Posted / kkparambath
SELECT DISTINCT Example
The "Persons" table:
P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger
Now we want to select only the distinct values from the
column named "City" from the table above.
We use the following SELECT statement:
SELECT DISTINCT City FROM Persons
The result-set will look like this:
City
Sandnes
Stavanger
| Is This Answer Correct ? | 7 Yes | 9 No |
Post New Answer View All Answers
What is the main difference between sql and pl/sql?
Is nosql faster than sql?
How do I remove sql developer from windows 10?
how to start mysql server? : Sql dba
Can a foreign key have a different name?
How do you pronounce sql?
Is clustered index a primary key?
What is the difference between local variables and global variables?
What is the difference between delete, truncate and drop command?
Why is there a need for sqlcode and sqlerrm variables?
What is difference between pl and sql?
Differentiate between sga and pga.
What is nvarchar max in sql?
What is difference between cursor and trigger?
What is difference between sql and excel?