Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 or statement

Author  Topic 

JJins
Yak Posting Veteran

81 Posts

Posted - 2010-12-03 : 12:09:44
Is there any danger in using an or statement. If yes what are the alternitives?


Update Ratedata
set rate = .006
FROM RateData INNER JOIN
Programs ON RateData.ProgramID = Programs.ProgramID
where (programs.policytype = 1 or programs.policytype = 6)and programs.state = 'FL' and programs.companyid = 2 and DCmax > .19 and ratedata.coverageid = 3 and programs.constructiontype = 1 and territory = 'A'

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2010-12-03 : 12:14:04
Should be ok - the optimiser knows about them - you'll need to check the query plan
you could use

programs.policytype in (1,6)


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -