IN Vs OR operator which is best to use sql server.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
how can u get last observation in an unknown dataset ?
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
How to apply cascading referential integrity in place of triggers?
About Indexed Views? with example? plz reply...
Can you pass expressions to function parameters?
What is difference between TRUNCATE and DELETE statement
wht's the differece between sqlserver05 and sqlserver2000
What are the tool windows in sql server management studio? : sql server management studio
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?
Does full backup break log chain?
Explain collation?
What is difference between group by and having?