Re: [SQL] How to copy data between joined columns?

2006-04-07 Thread Bryce Nesbitt
Tom Lane wrote: Bryce Nesbitt <[EMAIL PROTECTED]> writes: If it were for the same rows in the same table, I would not have asked. This is for columns from two tables, whos relationship is only meaningful after a join. You have to write out the join condition longhand, eg

Re: [SQL] How to copy data between joined columns?

2006-04-07 Thread Tom Lane
Bryce Nesbitt <[EMAIL PROTECTED]> writes: > If it were for the same rows in the same table, I would not have asked. > This is for columns from two tables, whos relationship is only > meaningful after a join. You have to write out the join condition longhand, eg UPDATE targettable SET targcol = sr

Re: [SQL] How to copy data between joined columns?

2006-04-07 Thread Bryce Nesbitt
Scott Marlowe wrote: > If it's for the same rows in the same table, you're overworking it. > > update table set field1=field2 where somecondition; > If it were for the same rows in the same table, I would not have asked. This is for columns from two tables, whos relationship is only meaningful a

Re: [SQL] How to copy data between joined columns?

2006-04-07 Thread Scott Marlowe
On Fri, 2006-04-07 at 15:32, Bryce Nesbitt wrote: > I have a need to copy/update data from one column to another, based on a > join condition. Is this easy to do in pure SQL? I have google'ed > without luck for a easy solution (that's not Microsoft specific, that > is). For example: > > postgre

[SQL] How to copy data between joined columns?

2006-04-07 Thread Bryce Nesbitt
I have a need to copy/update data from one column to another, based on a join condition. Is this easy to do in pure SQL? I have google'ed without luck for a easy solution (that's not Microsoft specific, that is). For example: postgres=# select xx_thing.date_start,xx_note.created_date from xx_th

[SQL] Modeling trees with Nested Sets and Nested Intervals

2006-04-07 Thread Daniel Browning
I would like to model some hierarchical (tree) data in PostgreSQL. Where can I find high quality Nested Set (or Nested Interval) source code and documentation? I know this question gets asked a lot. To illustrate the point, here is just one thread from each of the last five years: http://arc