Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    @StenPetrov, Thank you. It all depends on what you're trying to accomplish. The one thing I've learned to depend on in large, real-world production databases is the presence of bad data of one sort or another. And I prefer to avoid the 3 AM phone calls if I possibly can ;^) Commented Jul 10, 2014 at 18:39
  • :) still when that 3AM call comes in I'd much rather have to read 1 simple line than 10 complex ones. Adding variables further makes things worse, especially if another team member decided to calculate them on the fly and didn't check for non-negative @width... Commented Jul 11, 2014 at 5:09
  • Those added variables are just for generalization -- you can hard code the values. For the one liner, you can create a scalar function -- then you have your one liner. Commented Apr 30, 2015 at 18:45