December 2001
Intermediate to advanced
800 pages
17h 55m
English
Derived tables are SELECT statements that you embed within the FROM clause of other SELECTs in place of table references. I include coverage of them here for completeness and because they resemble implicit or automatic views. Derived tables make certain types of queries possible that previously required separate view objects. Listing 9-12 presents an example:
CREATE TABLE #1996_POP_ESTIMATE (Region char(7), State char(2), Population int) INSERT #1996_POP_ESTIMATE VALUES ('West', 'CA',31878234) INSERT #1996_POP_ESTIMATE VALUES ('South', 'TX',19128261) INSERT #1996_POP_ESTIMATE VALUES ('North', 'NY',18184774) INSERT #1996_POP_ESTIMATE VALUES ... |
Read now
Unlock full access