diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/et_tables.sql | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/et_tables.sql b/sql/et_tables.sql index 430f0ff6..a1d813f0 100644 --- a/sql/et_tables.sql +++ b/sql/et_tables.sql @@ -620,3 +620,23 @@ CREATE VIEW latest_cusip_model_numbers AS ORDER by cusip asc; GRANT ALL ON latest_cusip_model_numbers TO et_user; + +CREATE TABLE color( + ListDate date, + ListInfo text, + Cusip varchar(9), + Notional float, + Indications text, + Cover text, + ListColor text, + PRIMARY KEY(Cusip, Notional, ListDate, ListInfo) +); + +GRANT ALL ON color TO et_user; + +CREATE VIEW latest_color AS + SELECT b.* + FROM (SELECT MAX(ListDate) AS latestdate, cusip FROM color GROUP BY cusip) a + JOIN color b ON a.cusip = b.cusip AND a.latestdate=b.listdate; + +GRANT ALL ON latest_color TO et_user; |
