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 WHERE AND IN?
OR
1. SELECT * FROM EMPLOYEE WHERE EMPID=123
2. SELECT * FROM EMPLOYEE WHERE EMPID IN (123)
WHAT IS THE DIFFERENCE?

Answer Posted / shashi kishor prasad

The where Clause allows you to give so many conditions like
in the above case you can use
select * from employee where empid >122
select * from employee where empid <125
select * from employee where empid between 122 and 125
select * from employee where empid is not null(if null allowed)
and many moer..........
where as
The in clause allows you to give a no of values inside the
parenthesis decided by you like

select * from employee where empid in(123,1234,125)
or
select * from employee where empid in(select empid from
employee where empid>200)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the new features in sql server 2016?

973


What is inner join? Explain with an example?

1230


What are the properties of primary key?

976


What is the difference between Clustered and Non-Clustered Index?

1062


What do we have to check in database testing?

1023


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1112


How can sql server instances be hidden? : sql server security

1154


What are triggers? How do you invoke a trigger on demand?

1321


How can windows applications connect to sql servers via odbc?

1129


how you can list all the tables in a database?

1030


What is self contained scalar sub query?

977


where can you add custom error messages to sql server? : Sql server administration

1127


What happens when transaction log is full?

933


What is the use of keyword with encryption. Create a store procedure with encryption?

966


What is bulkcopy in sql?

951