Saturday, May 8, 2010

Create View

Using SQL, the following SQL "views" the code ID for a time series data from the Bureau of Economic Satistics. Thus, having a view I can look up the text associated with any sub section of the ID.
-- LI, SU
create view d1 as
select
substr(series_id,1,2) as prefix,
substr(series_id,3,1) as adj,
substr(series_id,4,1) as periodicity,
substr(series_id,5,4) as area,
substr(series_id,9,1) as base,
substr(series_id,10,7) as product
from seriesid;

No comments: