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

What are the reporting services components?

142


Explain various On-Delete options in a DB table. Which is the default option?

1461


What is the difference between row_number and dense_rank?

876


How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?

169


What is normalization and what are the advantages of it?

981


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

1052


How to create a dynamic cursor with the dynamic option?

1044


How do I find query history in sql server?

937


Write a sql query to delete duplicate records from a table called table1

1027


Where is localdb stored?

933


What is log in sql server?

1143


What is the difference between createstatement and preparedstatement?

936


What are the mathematical functions supported by sql server 2005?

1063


Explain forward - only cursors?

1054


What is resource governor?

962