IN Vs OR operator which is best to use sql server.

Answer Posted / harinireddy

in is peferable bcoz
by using in we can write set of values at time n check it
where as when we use or we need to mention for each n every
value
like ...
select emp_id from employee where emp_id in(1,2,3,4..)
but in case of or...
select emp_id from employee where emp_id=1 or emp_id=2 or
emp_id=3 or emp_id=4...

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to invoke a trigger on demand? : Sql server database administration

726


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

705


Explain what is sql server english query?

723


Which is faster statement or preparedstatement?

694


What is the difference between system objects and user objects?

878






What is merge statement?

795


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

666


What is sql stored procedure?

781


What is a bit datatype?

736


How can you append an identity column to a temporary table?

619


How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?

926


Suppose you want to implement the following relationships while designing tables. How would you do it?a.) One-to-oneb.) One-to-manyc.) Many-to-many

693


Explain what is the use of custom fields in report?

685


What are the different sql server versions?

680


How to rename databases in ms sql server?

814