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
What is faster join or union?
What are types of storage modes? : sql server analysis services, ssas
How can we delete Duplicate row in table?
Explain various On-Delete options in a DB table. Which is the default option?
Can we insert data into view sql server?
What do you mean by table and field in sql?
How to get all stored procedures in sql server?
What are cascading parameters in ssrs reports?
What is a derived table?
Should you normalize audio?
Can we perform backup restore operation on tempdb? : sql server database administration
What is standby servers? Explain types of standby servers.
What are different types of schemas?
How to execute a stored procedure in ms sql server?
What is a deadlock and what is a live lock?