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


Please Help Members By Posting Answers For Below Questions

What is default port number for sql server 2000?

610


What is transaction server distributed transaction?

571


Is null in sql server?

554


Explain a join?

627


Explain comment on transactions?

564






What do you mean by data integrity?

609


What is executereader?

561


What does Master database contains?

637


What are key constraints?

520


What is dknf in normalization form?

565


What are the filtered indexes?

609


What is bulkcopy in sql?

569


What is the synonym of join?

535


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

1522


How to end a stored procedure properly in ms sql server?

558