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

How to generate random numbers with the rand() function in ms sql server?

0 Answers  


What is simple indexing method?

0 Answers  


How to call a function from a stored procedure in SQL Server ?

0 Answers   HCL,


Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

0 Answers  


what is sql injection in sql server?

2 Answers   TATA,


Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input of particular value in a column of a table?

3 Answers   Accenture,


In which format does an image save in SQL Server database ?

0 Answers   MCN Solutions,


what are user defined datatypes and when you should go for them? : Sql server database administration

0 Answers  


What are scalar functions?

0 Answers  


what is lazy writer?

1 Answers   Wipro,


How to retrieve error messages using mssql_get_last_message()?

0 Answers  


Why I am getting this error when renaming a database in ms sql server?

0 Answers  


Categories