populate value of column
| От | novice |
|---|---|
| Тема | populate value of column |
| Дата | |
| Msg-id | ddcb1c340708072230pe7e096bx40fe3e8b348a69de@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: populate value of column
Re: populate value of column |
| Список | pgsql-sql |
I have a table
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);
select meter_id, area_no from meter;
meter_id | no_of_bays
----------+------------ 1001 | 4 1012 | 6
How can I generate the following result?
meter_id | bay
----------+------------ 1001 | 01 1001 | 02 1001 | 03 1001 | 04 1012 |
01 1012 | 02 1012 | 03 1012 | 04 1012 | 05 1012 | 06
В списке pgsql-sql по дате отправления: