[SQL] Re: UPDATE with concatenate

2001-06-12 Thread Rene Pijlman
[EMAIL PROTECTED] (Laurent Patureau) schreef: >UPDATE table SET col .= '$val' Try: UPDATE table set col = col || '$val' http://www.postgresql.org/idocs/index.php?functions-string.html -- Vriendelijke groet, René Pijlman <[EMAIL PROTECTED]> Wat wil jij leren? http://www.leren.nl/ -

[SQL] Re: update from another table

2001-06-12 Thread JWR
That doesn't tend to work in any SQL database I've ever used, though I'm told Informix can do something similiar. You need to insert the data into a temp table then delete the rows in the base table, then insert back from the temp table. Yeah it is a pain. John "ivan" <[EMAIL PROTECTED]> wrot

[SQL] Re: Update

2001-04-13 Thread Kyle
Tom Lane wrote: > Kyle <[EMAIL PROTECTED]> writes: > > It appears that the first function would get evaluated first under 7.0.3 > > but the last function gets evaluated first under 7.1. Is that accurate? > > Actually, I was under the impression that (all else being equal) WHERE > clauses would g

[SQL] Re: Update

2001-04-12 Thread Tom Lane
Kyle <[EMAIL PROTECTED]> writes: > It appears that the first function would get evaluated first under 7.0.3 > but the last function gets evaluated first under 7.1. Is that accurate? Actually, I was under the impression that (all else being equal) WHERE clauses would get evaluated right-to-left i

[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