Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between UNIQUE and DISTINCT keywords in DBMS?



What is the difference between UNIQUE and DISTINCT keywords in DBMS?..

Answer / 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

More SQL Server Interview Questions

What are the lambda triggers?

0 Answers  


What is the datatype returned by count(*)

22 Answers   247Customer, Asian CERC,


What is difference between equi join and natural join?

0 Answers  


What is row by row processing ?

2 Answers  


How to update muliple row in single query?

0 Answers   MCN Solutions,


What is difference between rollback immediate and with no_wait during alter database?

0 Answers  


Do you know what guidelines should be followed to help minimize deadlocks?

0 Answers  


How do I start sql server 2017?

0 Answers  


Can Having clause be used without Group by clause?

6 Answers   CarrizalSoft Technologies, CSC, CTS,


Does partitioning improve performance sql server?

0 Answers  


What is the disadvantages of index?

3 Answers   TCS,


Explain the storage models of OLAP?

1 Answers  


Categories