What is the difference between UNIQUE and DISTINCT keywords in DBMS?
Answer Posted / anjaligarg
First we declare is as primary key and after group by we can get uniqu values.
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (ID)
);
SELECT ID, LastName,FirstName
FROM Persons
GROUP BY ID, LastName,FirstName;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the reporting services components?
Explain various On-Delete options in a DB table. Which is the default option?
What is the difference between row_number and dense_rank?
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
What is normalization and what are the advantages of it?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
How to create a dynamic cursor with the dynamic option?
How do I find query history in sql server?
Write a sql query to delete duplicate records from a table called table1
Where is localdb stored?
What is log in sql server?
What is the difference between createstatement and preparedstatement?
What are the mathematical functions supported by sql server 2005?
Explain forward - only cursors?
What is resource governor?