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
What are commit and rollback in sql?
Define candidate key, alternate key, and composite key.
Which are new data types introduced in sql server 2008?
What are the five characteristics of good data?
What are data files?
What are cascading parameters in ssrs reports?
What are the differences between stored procedure and the dynamic sql?
What is the difference between set and select?
How do you make a trace?
How do I manually uninstall an instance of sql server 2016?
How to select some specific columns from a table in a query in ms sql server?
What are the different editions available in sql server 2000?
What is cursor in ms sql server?
Explain the creation and execution of a user-defined function in the sql server?
What is the purpose of the tempdb database?