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 sql dirty pages?

552


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

509


Tell me what is log shipping?

567


How to defragment indexes with alter index ... Reorganize?

583


Is port 1433 secure?

536






What does Master database contains?

626


what is the sql equivaent of the dataset relation object ?

1567


What are the properties of the transaction?

541


Explain what is “asynchronous” communication in sql server service broker?

493


Some queries related to SQL

584


How to recover from sql injection? : sql server security

520


Does sql server 2000 clustering support load balancing?

564


Explain about SQL server 2005?

557


Difference between Inner vs outer joins?

531


What is resultset concur_updatable?

581