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 does select 1 mean?

0 Answers  


Explain transaction server implicit?

0 Answers  


Find first and last day of current month in sql server

0 Answers  


Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .

0 Answers   HCL,


How to execute stored procedure and set temp table in sql server?

0 Answers  


What are sql server procedures?

0 Answers  


what is a cursor and what is its use?

2 Answers   L&T,


What sql server means?

0 Answers  


Does any body please help me what question's have asked for SSRS in the interview?

0 Answers  


What are recommended options to be used while using db mirroring? : sql server database administration

0 Answers  


How to insert multiple rows with a subquery?

0 Answers  


What is transaction server auto commit?

0 Answers  


Categories