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 |
Do you know the isolation level that sql server support?
How to name query output columns in ms sql server?
How to know the NAME of the Database and SIZE of the Database at the client node in Sql Server 2005
According to you what goes into making the best database administrator? : sql server database administration
What is GUID in sql server?
how to update a null value field in sql server eg a table contains 3 fields id,name,salary and 3 records salary of 1 record is null i want update the nullfield 111 arun 300 112 ddd 200 113 ttt null i want to update table with add 100 to every record include null after updation the recrds should be 111 arun 400 112 ddd 300 113 ttt 100
What are the new security features added in sql server 2012? : sql server security
Does a specific recovery model need to be used for a replicated database? : sql server replication
from the table display the 2nd highest salary? and also the least 2nd salay?
How to Rebuild Master database in sql server 2005.
What is a transact-sql statement batch in ms sql server?
Why use triggers?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)