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

Define views.

0 Answers  


What is the difference between UNIQUE and DISTINCT keywords in DBMS?

1 Answers   Genpact,


What is the difference between the following two sql statements select count(*) from <tablename> select count(col_name) from <tablename>

5 Answers   247Customer,


What are the different types of collation sensitivity in sql server?

0 Answers  


What are the different ways of moving data/databases between servers and databases in SQL Server?

3 Answers   HCL,


Explain syntax for viewing, dropping and disabling triggers?

0 Answers  


List the advantages of using stored procedures?

0 Answers  


Explain the commands in sql server?

0 Answers  


Describe in brief databases and sql server databases architecture.

0 Answers  


Which is faster statement or preparedstatement?

0 Answers  


What is co-related sub query?

0 Answers  


What is the difference between join and inner join?

0 Answers  


Categories