| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Bill Guion | Date: | November 5 2006 2:50pm |
| Subject: | Default Column Value | ||
| View as plain text | |||
In one of my tables I have a start_date - timestamp (2007-07-04). A
separate column, start_yr_mo, has 200704 (first seven characters of
timestamp without the '-'). Both are entered manually. Can I define
start_yr_mo as a default of, for example, set start_yr_mo =
concat(substr(start_date, 1, 4),substr(start_date,6,2)). Something
like
ALTER TABLE events
ALTER start_yr_mo start_yr_mo
SET = concat(substr(start_date, 1, 4),substr(start_date,6,2));
-----===== Bill =====-----
| Thread | ||
|---|---|---|
| • Default Column Value | Bill Guion | 5 Nov |
| • Re: Default Column Value | Christian Hammers | 5 Nov |
| • Re: Default Column Value | Martijn Tonies | 6 Nov |
