Creating a view on a single table
You can create a view on a single table to show a subset of the data that the table contains. Compared with the original table, the view can have fewer records and fewer columns, and the columns in the view can have a different order.
The following example procedure shows how to create a view
on a single table. The view is built on the INVENTORY_LIST table.
The table has six columns, but the view uses only three of the columns:
ITEM_NUMBER, LAST_ORDER_DATE, and QUANTITY_ON_HAND. The order of the
columns in the SELECT clause is the order in which they appear in
the view. The view contains only the rows for items that were ordered
in the last two weeks. The CREATE VIEW statement looks like this:
The result looks like this.
Display Data
Data width . . . . . . : 26
Position to line . . . . . Shift to column . . . . . .
....+....1....+....2....+.
ITEM LAST QUANTITY
NUMBER ORDER ON
DATE HAND
303476 05/30/07 100
******** End of data ********
Bottom
F3=Exit F12=Cancel F19=Left F20=Right F21=Split
The only row selected by the view is the row that you updated to have the current date. All other dates in the table still have the null value so they are not returned.