RTFM on 'ALTER TABLE ADD COLUMN', 'CASE' and 'IS NULL' P.
On Wed, Jun 29, 2011 at 10:33 AM, Conor Henley <[email protected]> wrote: > Hi all, > > > > I’m working with parcel data from several different regional sources. In > some cases, the parcel data comes with a households field, in others with a > dwelling units field (in rare cases, both). In all cases, I need both. > Luckily, either can be calculated from the other using census multipliers. > > > > 1. What is the best way to add the missing column when it does not > exist? > > > > 2. Then, how should I go about populating the newly created field > using a calculation based on the other field (keeping in mind that I don’t > want to overwrite either field in the case that both existed in the input > data)? > > > > Ideally, I would be able to add the missing field in cases where it does not > exist and populate its rows using a calculation based on the existing > field. Because this step must nest in a larger set of processes, it is > impractical to check manually each time a new input goes through. I’ve seen > a good deal of discussion of this topic on forums but haven’t seen any clear > solutions. > > > > Thanks, > > > > > > Conor Henley > > GIS/Regional Planning Intern > > > > C A L T H O R P E A S S O C I A T E S > > 2095 ROSE STREET, SUITE 201, BERKELEY, CALIFORNIA, 94709 USA > 510-548-6800 | 510 548-6848 (fax) > > [email protected] | www.calthorpe.com > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
