Re: populate value of column - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: populate value of column
Date
Msg-id 113AAF3D-9E86-4A69-8CDB-5A224C8FC3BE@seespotcode.net
Whole thread Raw
In response to populate value of column  (novice <user.postgresql@gmail.com>)
List pgsql-sql
On Aug 8, 2007, at 0:30 , novice wrote:

> CREATE TABLE meter
> (
>   meter_id integer NOT NULL,
>   area_no integer NOT NULL,
>   CONSTRAINT meter_pkey PRIMARY KEY (meter_id)
> ) ;
>
> INSERT INTO meter(meter_id, no_of_bays) VALUES (1001, 4);
> INSERT INTO meter(meter_id, no_of_bays) VALUES (1012, 6);

Your insert columns don't match your table.

> How can I generate the following result?
>
>  meter_id | bay
> ----------+------------
>      1001 |         01

Your column headers don't match your table definition *or* your  
insert statements. I'm not sure what you're trying to do. Can you  
explain the result you want?  (And in the future, please post actual  
DDL and statements.)

Michael Glaesemann
grzm seespotcode net




pgsql-sql by date:

Previous
From: "Phillip Smith"
Date:
Subject: Re: populate value of column
Next
From: novice
Date:
Subject: Re: populate value of column