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

Can we add an identity column to decimal datatype?

0 Answers  


What kind of problems occurs if we do not implement proper locking strategy?

0 Answers  


What is the difference between cross join and Full outer join?

1 Answers   HP, Standard Bank,


Can foreign key be deleted?

0 Answers  


What is Transaction?

2 Answers  


what is the difference between count(*) and count(1) ?

0 Answers   MCN Solutions,


Can we add a cpu to sql server?

0 Answers  


Explain what are db_options used for?

1 Answers   InterGraph,


CTE(common table expression)

1 Answers   Thomson Reuters,


What is difference between order by and group by?

0 Answers  


How to return the date part only from a sql server datetime datatype?

0 Answers  


how you can list all the tables in a database?

0 Answers  


Categories