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 default port number for sql server 2000?
What is transaction server distributed transaction?
Is null in sql server?
Explain a join?
Explain comment on transactions?
What do you mean by data integrity?
What is executereader?
What does Master database contains?
What are key constraints?
What is dknf in normalization form?
What are the filtered indexes?
What is bulkcopy in sql?
What is the synonym of join?
In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram
How to end a stored procedure properly in ms sql server?