Selecting Specific Columns

Selecting Specific Columns

You can use the SELECT statement to display specific columns of the table by specifying the column
names, separated by commas. The example in the slide displays all the department numbers and
location numbers from the DEPARTMENTS table.

                     SELECT department_id, location_id FROM departments;



In the SELECT clause, specify the columns that you want in the order in which you want them to
appear in the output. For example, to display location before department number (from left to right),
you use the following statement:

                    SELECT location_id,department_id FROM departments;


Column Heading Defaults


SQL Developer:
                               Default heading alignment: Left-aligned
                               Default heading display: Uppercase

SQL*Plus:
                              Character and Date column headings are left-aligned.
                              Number column headings are right-aligned.
                              Default heading display: Uppercase

                     SELECT last_name, hire_date, salary FROM employees;









No comments:

Post a Comment