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 does the on update no action do?
How to locate and take substrings with charindex() and substring() functions?
What is etl - extraction, transformation, and loading?
Explain temporary table vs table variable by using cursor alternative?
How to receive returning result from a query?
What are the disadvantages of merge replication?
What is optimization and its types?
Explain table valued parameters in sql server? Why tvp used?
What are different types of statements that are supported by sql?
What can be used instead of trigger?
Write a query for primary key constraint with identity key word?
Explain the xml support sql server extends?
What is sleeping status in sql server?
role of sql sever 2005 in database rather than any other database
List the different index configurations possible for a table?