Re: populate value of column

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: novice <user(dot)postgresql(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: populate value of column
Date: 2007-08-08 05:40:20
Message-ID: 113AAF3D-9E86-4A69-8CDB-5A224C8FC3BE@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message novice 2007-08-08 05:50:25 Re: populate value of column
Previous Message Phillip Smith 2007-08-08 05:37:22 Re: populate value of column