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
Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?
How can a user-defined datatype be created?
Difference between group by clause and having clause in SQL?
How to create percentile function?
Can we write a distributed query and get some data which is located on other server and oracle database?
Difference between Logical Page and Physical Page in SSRS.
What are .mdf files?
Why do we use non clustered index?
How to find the version of sql server? : sql server database administration
How many levels of sp nesting is possible?
What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
What is a partition function in sql server?
What is data compression?
How do you rebuild an identity column?
How will you make an attribute not process? : sql server analysis services, ssas