Contents > Developing ColdFusion MX Applications > Introduction to Databases and SQL > Using SQL > Reading data from a database Results of a SELECT statement PreviousNext

Results of a SELECT statement

When the database processes a SELECT statement, it returns a record set containing the requested data. The format of a record set is a table with rows and columns. For example, if you write the following query:

SELECT * FROM employees WHERE DeptID=3

The query returns the following table:

Since the data returned to ColdFusion MX by a SELECT statement is in the form of a database table, ColdFusion MX lets you write a SQL query on the returned results. This functionality is called query of queries. For more information on query of queries, see Accessing and Retrieving Data.

The next example uses a SELECT statement to return only a specific set of columns from a table:

SELECT LastName, FirstName FROM employees WHERE DeptID=3

The query returns the following table:


Contents > Developing ColdFusion MX Applications > Introduction to Databases and SQL > Using SQL > Reading data from a database Results of a SELECT statement PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.