O'Reilly logo

Sams Teach Yourself ColdFusion® in 21 Days by Charles Mohnike

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

Understanding Column Aliases

In the introduction to SQL in Day 5, you learned that when you use <CFQUERY> to select records from a datasource, the selected records are returned as variable values corresponding to the field names in your table. Take a look at a sample Microsoft Access table in Figure 19.1.

Figure 19.1. A sample database table in Microsoft Access, designed and named with ColdFusion in mind.

If you've already read Day 2, "Anatomy of a ColdFusion Application," you'll remember this same table from some of the examples there. To access records in this table, you might use a query like this:

 <CFQUERY NAME="get_songs" DATASOURCE="elvis"> ...

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