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
Are views faster than queries?
Does oracle use sql?
What is trigger and types?
What is a primary key example?
what is the stuff function and how does it differ from the replace function? : Sql dba
Explain the difference between drop and truncate commands in sql?
What is the default isolation level in sql server? : Transact sql
How long does it take to learn pl sql?
What are the possible values for the boolean data field?
What does pragma mean?
What is null in pl/sql?
Explain autonomous transaction.
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
What is data type in sql?
What are %type and %rowtype for?