| From: | Graham Leggett <minfrin(at)sharp(dot)fm> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Normalising an existing table - how? |
| Date: | 2004-06-24 18:51:08 |
| Message-ID: | 40DB229C.9040306@sharp.fm |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Hi all,
I have an existing table containing a column in it containing a money
value. I would like to normalise this column into a separate table, as
the money value is to be expanded to contain a tax value, etc.
I have been trying to find a SQL query that will do the following:
- Select the money column from the table
- Populate the new normalised table with each row containing the value
from the original money column
- Write the primary keys of the new rows in the normalised table, back
to a new column in the original table added for this purpose.
This third step I am struggling with - can anyone suggest a query that
might achieve the writing back of the primary key to the original table?
Regards,
Graham
--
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Sullivan | 2004-06-24 19:27:14 | Re: feature request ? |
| Previous Message | Stephan Szabo | 2004-06-24 18:41:42 | Re: feature request ? |