O'Reilly logo

The Language of SQL, Second Edition by Larry Rockoff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3. Calculated Fields and Aliases

Keywords Introduced

AS

In the previous chapter, we talked about how to choose individual columns for inclusion in a SELECT statement. We now want to introduce a way to perform calculations on the individual data items retrieved from a database. This technique is referred to as calculated fields. Using this approach, customer names can be formatted exactly as desired. Numeric calculations specific to a business or organization can be formulated and presented. In short, SQL developers are often required to customize the content of individual columns in order to successfully turn data into more intelligent information. The inclusion of calculated fields is a useful device that helps to accomplish that goal.

When ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required