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 / aditya bisoi

Actually Both Query will return Same Result....
But Performance wise 1st Query better..Bcz it will return the Exact Record with out check hole record in the table....

But when we use IN operator then the sql engine will do the Table scan and retrive the Result...

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are commit and rollback in sql?

573


Define candidate key, alternate key, and composite key.

544


Which are new data types introduced in sql server 2008?

617


What are the five characteristics of good data?

527


What are data files?

585






What are cascading parameters in ssrs reports?

176


What are the differences between stored procedure and the dynamic sql?

592


What is the difference between set and select?

587


How do you make a trace?

593


How do I manually uninstall an instance of sql server 2016?

556


How to select some specific columns from a table in a query in ms sql server?

511


What are the different editions available in sql server 2000?

598


What is cursor in ms sql server?

575


Explain the creation and execution of a user-defined function in the sql server?

590


What is the purpose of the tempdb database?

585