Re: [SQL] Need a sample Postgre SQL script

2008-07-02 Thread Dhanushka Samarakoon
Worked perfectly. Thanks Richard. On Tue, Jul 1, 2008 at 10:17 AM, Richard Huxton <[EMAIL PROTECTED]> wrote: > Dhanushka Samarakoon wrote: > >> Thanks for the reply. >> But one problem I have is I need to loop through all the rows in the table >> and in each iteration I need to fetch the value of

Re: [SQL] Need a sample Postgre SQL script

2008-07-01 Thread Richard Huxton
Dhanushka Samarakoon wrote: Thanks for the reply. But one problem I have is I need to loop through all the rows in the table and in each iteration I need to fetch the value of mydate in to a variable and split it to month and year and add two rows with *value, 91, month* (2 , 91, Augest) and *val

Re: [SQL] Need a sample Postgre SQL script

2008-07-01 Thread Dhanushka Samarakoon
Thanks for the reply. But one problem I have is I need to loop through all the rows in the table and in each iteration I need to fetch the value of mydate in to a variable and split it to month and year and add two rows with *value, 91, month* (2 , 91, Augest) and *value, 86, year* (2 , 86 , 2009)

Re: [SQL] Need a sample Postgre SQL script

2008-07-01 Thread Richard Huxton
Dhanushka Samarakoon wrote: Hi All, I'm kind of new to Postgre and I need some advice. No problem. It's PostgreSQL or Postgres by the way. I have the following table. metadata (value:integer , field:integer , mydate:text) given below is a sample record from that. ( 2 , 16 , Augest 2009) I

[SQL] Need a sample Postgre SQL script

2008-07-01 Thread Dhanushka Samarakoon
Hi All, I'm kind of new to Postgre and I need some advice. I have the following table. metadata (value:integer , field:integer , mydate:text) given below is a sample record from that. ( 2 , 16 , Augest 2009) I need a script that will read the above table and for each such row it will insert two