Re: [SQL] can a insert with a returning clause be subquery ?

2008-02-02 Thread Jonah H. Harris
On Feb 2, 2008 7:40 PM, Adrian Klaver <[EMAIL PROTECTED]> wrote: > Would this be a variation of this item from the TODO: > > * Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause Exactly. -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation

Re: [SQL] can a insert with a returning clause be subquery ?

2008-02-02 Thread Adrian Klaver
On Saturday 02 February 2008 4:12 pm, Jonah H. Harris wrote: > On Feb 2, 2008 6:22 PM, chrisj <[EMAIL PROTECTED]> wrote: > > I know I could do this easily with a stored proc, > > but it seems like an obvious use of the returning clause > > > > Am I missing some syntax error > > Nope, you're not mi

Re: [SQL] can a insert with a returning clause be subquery ?

2008-02-02 Thread Jonah H. Harris
On Feb 2, 2008 6:22 PM, chrisj <[EMAIL PROTECTED]> wrote: > I know I could do this easily with a stored proc, > but it seems like an obvious use of the returning clause > > Am I missing some syntax error Nope, you're not missing anything. When I initially wrote this for Postgres, it didn't suppo

[SQL] can a insert with a returning clause be subquery ?

2008-02-02 Thread chrisj
I am trying to accomplish this: update p2user.party set ADDR_KEY = (insert into p2user.address ( street_no, street_name) values ('22', 'Geek St.') returning addr_key ) where party_key = 22 ; But I am getting error: ERROR: syntax error at or near "into" LINE 1

Re: [SQL] aggregate reverse

2008-02-02 Thread Marcin Krawczyk
Yes, you got me well. That's exactly what I was trying to achieve. Thank you. 2008/2/1, Pavel Stehule <[EMAIL PROTECTED]>: > > Hello > > I am not sure if I understand well. > > On 01/02/2008, Marcin Krawczyk <[EMAIL PROTECTED]> wrote: > > Hi all. I wolud like to know whether it is possible to rev