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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / swaraj

hi i am swaraj.
Ans:-

As per my opinion The IN operator is best B'coz
Due to IN operator at one time multipale requirtment
van satisfied
But Due to OR operator Only one requirtment get satisfied.
So IN operator is Good.

Is This Answer Correct ?    2 Yes 1 No

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

Answer / swaraj

hi i am swaraj.
Ans:-

As per my opinion The IN operator is best B'coz
Due to IN operator at one time multipale requirtment
van satisfied
But Due to OR operator Only one requirtment get satisfied.
So IN operator is Good.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / sandeep rana

Both are used for different purposes like...

select * from table where data in(1,2,3,4,5,6)


select * from table where data in(1,2,3,4,5,6) or data1
like('%s','%t')

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

how can u get last observation in an unknown dataset ?

0 Answers   Genpact,


you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

0 Answers  


How to apply cascading referential integrity in place of triggers?

0 Answers  


About Indexed Views? with example? plz reply...

2 Answers  


Can you pass expressions to function parameters?

0 Answers  






What is difference between TRUNCATE and DELETE statement

12 Answers   CTS,


wht's the differece between sqlserver05 and sqlserver2000

3 Answers  


What are the tool windows in sql server management studio? : sql server management studio

0 Answers  


A user is a member of the public role and the sales role. The public role has select permission on all the tables. The sales role does not have select permission on some of the tables will the user be able to select from all tables?

0 Answers  


Does full backup break log chain?

0 Answers  


Explain collation?

0 Answers  


What is difference between group by and having?

0 Answers  


Categories