[SQL] What is wrong with this PostgreSQL UPDATE statement??

2008-08-22 Thread Steve Johnson
Sorry for the fairly long post. I'm having a big problem trying to update one table from another in PostgreSQL 8.3.1. I have a lookup table called termgroup: # select * from termgroup; termgroupname | mindays | maxdays ---+-+- 1-30 days | 1 | 30 31-59

Re: [SQL] What is wrong with this PostgreSQL UPDATE statement??

2008-08-22 Thread Stephan Szabo
On Fri, 22 Aug 2008, Steve Johnson wrote: update certgroups set termgroupname = tg.termgroupname from certgroups c, termgroup tg where (c.days = tg.mindays) and (c.days = tg.maxdays); In recent PostgreSQL versions I believe this is properly written: update certgroups c set termgroupname =

Re: [SQL] What is wrong with this PostgreSQL UPDATE statement??

2008-08-22 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Fri, 22 Aug 2008, Steve Johnson wrote: update certgroups set termgroupname = tg.termgroupname from certgroups c, termgroup tg where (c.days = tg.mindays) and (c.days = tg.maxdays); In recent PostgreSQL versions I believe this is properly written: