Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

sql server 2008 - Tips on Creating More Efficient Queries

Hi experts, i am reading about Tips on Creating More Efficient Queries

Expressions that use column names in search arguments – WHERE (Price + $10) > $20

how I can replace this: WHERE (Price + $10) > $20
0
enrique_aeo
Asked:
enrique_aeo
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
> WHERE (Price + $10) > $20
take you math course..
X + 10 > 20  can also be written as X > 20 - 10

this way, X stands alone, and the "math" of 20-10 will be done once (is a constant), instead of having to do the math X + 10 for each row, and compare that to a constant
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now