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 |
Please tell me some knowledge about Clustering and how to add clustering?
What is row_number()?
What command do we use to rename a db, a table and a column?
How to use wildcard characters in like operations in ms sql server?
What is the Query of getting last 10 transaction Reports (like insert, update, Delete Data from Tabele) ?
What is difference between foreign key and unique key?
What is a recursive stored procedure in sql server?
What is update_statistics command?
How to enforce security in sql server? : sql server security
What are the new data types are introduced in sql 2000?
Which virtual table does a trigger use?
what is isolation level at dead lock?
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)