Doing Calculations with SQL - Part 2
By: Tom Muck on Thursday, April 23, 2009
Reader Level: 
In the last article in this series I talked about calculations on a web page. There are two ways that this can be done—in your scripting language on the web page (PHP, ColdFusion, C#, or other languages) or in the SQL statement that retrieves the results from the database. For displaying data, it is almost always a better idea to create the calculations in your SQL statement, to keep the business logic out of the web page and take advantage of the data processing speed in the database.
This second, and last, part will show a few simple examples of doing calculations directly in INSERT and UPDATE statements, and when not to use the technique. The article is intended as a basic introduction to doing calculations in SQL and to get the reader thinking about alternative ways of doing things.
The Doing Calculations with SQL Series:
Doing Calculations with SQL - Part 1
Doing Calculations with SQL - Part 2
Purchase this item
You can purchase this piece of content separately for
$4.00
Want more?
Community MX members get unlimited access to daily articles,
tutorials, extensions and support. The most comprehensive
resource for Macromedia designers and developers today.
Take a tour of what we offer, and discover the benefits
of subscribing.
Already a member?
Simply log in using the form in the top right area of the site.

