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
How to loop through result set objects using odbc_fetch_row()?
When would you use sql joins?
What are triggers in ms sql server?
Is INSTEAD OF trigger directly applicable to Table ?
Relational calculus is what type of language?
What to check if a User database is locked?
How to disable triggers using "disable trigger"?
What is a result set object returned by mssql_query()?
What is use of attributehierarchyenabled? : sql server analysis services, ssas
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
What is the meaning of resultset type_scroll_insensitive?
How do you test your database? : sql server database administration
What is logshipping and its purpose?
What is the difference between a function and a trigger?
How to create user defined functions with parameters?