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?

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


Please Help Members By Posting Answers For Below Questions

Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

1030


How can a user-defined datatype be created?

1036


Difference between group by clause and having clause in SQL?

1026


How to create percentile function?

159


Can we write a distributed query and get some data which is located on other server and oracle database?

1277


Difference between Logical Page and Physical Page in SSRS.

491


What are .mdf files?

1016


Why do we use non clustered index?

1132


How to find the version of sql server? : sql server database administration

1163


How many levels of sp nesting is possible?

1099


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

938


What is a partition function in sql server?

1216


What is data compression?

1066


How do you rebuild an identity column?

996


How will you make an attribute not process? : sql server analysis services, ssas

1159