In This Chapter
SELECT is the most important and the most complex SQL statement. You can use it, along with the SQL statements INSERT, UPDATE, and DELETE, to manipulate data. You can use the SELECT statement in the following ways:
The SELECT statement is the primary way to query information in a database. It is your key to retrieving data in a program, report, screen form, or spreadsheet.
This chapter shows how you can use the SELECT statement to query on and retrieve data in a variety of ways from a relational database. It discusses how to tailor your statements to select columns or rows of information from one or more tables, how to include expressions and functions in SELECT statements, and how to create various join conditions between relational database tables.
This chapter introduces the basic methods for retrieving data from a relational database. More complex uses of SELECT statements, such as subqueries, outer joins, and unions, are discussed in Chapter 3, "Composing Advanced SELECT Statements." The syntax and usage for the SELECT statement are described in detail in Chapter 1 of the Informix Guide to SQL: Syntax.
Most examples in this chapter come from the tables in the stores7 demonstration database, which is installed with the software for your Informix SQL API or database utility. In the interest of brevity, the examples show only part of the data that is retrieved for each SELECT statement. For information on the structure and contents of the stores7 database, see Appendix A in the Informix Guide to SQL: Reference. For emphasis, keywords are shown in uppercase letters in the examples, although SQL is not case sensitive.
|