[SQL] Re: update help

2001-01-17 Thread Tom Lane
Carolyn Lu Wong <[EMAIL PROTECTED]> writes: > Forgot to mention that I'm using V6.5. Oh. 6.5's support for sub-selects is pretty limited :-(. I think the only way to do it in 6.5 is with a temp table, eg SELECT id, sum(amount) as sum into temp table tt from t2 group by id; update t1 set amount

[SQL] Re: update help

2001-01-17 Thread Carolyn Lu Wong
Forgot to mention that I'm using V6.5. It doesn't seem to like subqueries, got the following error: ERROR: parser: parse error at or near "select" What I really want to do is follows t2: ID Amount --- 1 1 .. 1

[SQL] Re: update help

2001-01-17 Thread Carolyn Lu Wong
This update field with the sum of all amounts in t2. I want to update sum of each individual IDs. Tubagus Nizomi wrote: > > update t1 > set amount = sum(b.amount) > from ts b > where a.id=b.id > > On Thursday 18 January 2001 09:54, Carolyn Wong wrote: > > I'd like to know what's the correct SQ