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 / saiteja
In the case of where clause it displays single row,or operator can be placed in where clause in oreder to extend rows.
In IN operator at a time we can place empid multiple times but they must be unique.
ex:
(
select * from emp
where empid=123
);
By using OR operator:
(
select * from emp
where empid=123 or empid=234
);
By using IN operator:
(
select * from emp
where empid IN(123)
);
accordidg to the question the output will be same in both thae cases..
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What extended events?
What is abstracting periodical?
Explain features and concepts of analysis services?
What is resource governor?
Explain the use of containers in ssis?
How do I perform an unattended install of sql server 2000?
Explain security with sql azure?
How to get a list of columns using the "sp_help" stored procedure in ms sql server?
explain different types of cursors? : Sql server database administration
Is sql server is free?
Mention what are the core components of ssrs?
Explain what you mean by 3 tier architecture.
How to remove duplicate rows from table except one?
How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?
What are the parts of a function?