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

What is a result set object returned by mssql_query()?

575


explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

642


what is difference between view and Dip.

1995


What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas

542


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2012






What are the steps to follow to configure SQL*Net?

559


What are click through reports?

99


What is log shipping?

558


Why variables called the most powerful component of ssis?

589


How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?

580


What do you do in data exploration

560


difference between Clustered index and non clustered index ?

570


What is a transaction and why is it important?

565


What are statistics?

566


What is raid and what are different types of raid levels?

589