Manage Learn to apply best practices and optimize your operations.

How to code the SELECT clause

Figure 3-3 presents an expanded syntax for the SELECT clause. The keywords shown in the first line allow you to restrict the rows that are returned by a query. You'll learn how to code them in a moment. But first, you'll learn various techniques for identifying which columns are to be included in a result set.

How to code column specifications Figure 3-3 summarizes the techniques you can use to code column specifications. You saw how to use some of these techniques in the previous figure. For example, you can code an asterisk in the SELECT clause to retrieve all of the columns in the base table, and you can code a list of column names separated by commas. Note that when you code an asterisk, the columns are returned in the order that they occur in the base table.

You can also code a column specification as an expression. For example, you can use an arithmetic expression to perform a calculation on two or more columns in the base table, and you can use a string expression to combine two or more string values. An expression can also include one or more functions. You'll learn more about each of these techniques in the topics that follow.

The expanded syntax of the SELECT clause


 SELECT [ALL|DISTINCT] column_specification [[AS] result_column] [, column_specification [[AS] result_column]] ...


Clause Description

Dig Deeper on Oracle development languages

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.