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

Exploring the Basics of the SELECT Statement

SELECT statements give SQL its seemingly magical powers. They do this by giving ColdFusion the capability to find a specific record or set of records based on criteria you choose.

Let's start with a sample table. In Table 5.1, I've reproduced the contents of the songs table from my database of Elvis trivia.

Table 5.1. songs
ID Title Released Rating
1 Baby, Let's Play House 1954 yeee-haw!
2 Good Rockin' Tonight 1954 yeee-haw!
3 Money Honey 1956 yeee-haw!
4 Teddy Bear 1957 OK, I guess
5 A Big Hunk O'Love 1959 OK, I guess
6 Bossa Nova Baby 1963 uh-oh
7 Devil In Disguise 1963 yeee-haw!
8 Do The Clam 1965 uh-oh
9 Don't Cry Daddy 1969 the end is near

Pretty basic stuff—three fields, plus the ID, or key

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