Need a sample Postgre SQL script

Поиск
Список
Период
Сортировка
От Dhanushka Samarakoon
Тема Need a sample Postgre SQL script
Дата
Msg-id 93e317cd0807010731o7655a1d5j76c6bb2482cea910@mail.gmail.com
обсуждение исходный текст
Ответы Re: Need a sample Postgre SQL script  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Hi All,<br /><br />I'm kind of new to Postgre and I need some advice.<br />I have the following table.<br />metadata
(value:integer, field:integer , mydate:text)<br /><br />given below is a sample record from that.<br />( 2 , 16 ,
Augest2009)<br /><br />I need a script that will read the above table and for each such row it will insert two rows as
below.<br/><br />( 2 , 91 , Augest )<br />( 2 , 86 , 2009 )<br /><br />16, 91 and 86 are static values. <u>value and
fieldtogether</u> creates the primary key.<br /><br />I could figure out and write the logic for this. I only need a
littlebit similar sample script so that I can figure out Postgre syntax.<br />Like <br />- Loop syntax to through all
therows return by a select *<br />- How to assign that value to a parameter<br /> - using that parameter in the Insert
statement<br/>- etc ...<br /><br />Thanks,<br />Dhanushka.<br /><br /> 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Gary Stainburn
Дата:
Сообщение: Re: Quick select, slow update - help with performance problems
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Need a sample Postgre SQL script