Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > CREATE VIEW >

Naming View Columns

The number of columns that you specify in the column list must match the number of columns returned by the SELECT statement that defines the view. If you do not specify a list of columns, the view inherits the column names of the underlying tables. In the following example, the view herostock has the same column names as the columns in Projection clause of the SELECT statement:

CREATE VIEW herostock AS
   SELECT stock_num, description, unit_price, unit, unit_descr
      FROM stock WHERE manu_code = 'HRO'

You must specify at least one column name in the following circumstances:

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]