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 difference between “where” and “having” clause in sql server?

1132


Can we return Data from 4(more than 1) tables in stored procedure?

1109


What is GUID in sql server?

1223


How do you delete a data source?

1052


Give an example of why you would want to denormalize a database

1031


How to find the second highest salary of an employee?

1223


Other than truncate statement, which other command can by-pass the trigger on the tables?

1190


Explain transaction server consistency?

1019


How can we rewrite sub-queries into simple select statements or with joins?

1029


What do we need queues in sql service broker?

1123


How to rebuild master databse?

1128


How to define output parameters in stored procedures?

1084


What is the difference between stored procedure and user defined functions?

1237


What is shared lock?

948


What is a join in sql? What are the types of joins?

1191