select avanced

From: cristianopintado(at)gmail(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: select avanced
Date: 2008-02-27 14:10:41
Message-ID: b9e54b18-830d-4b9a-b21f-63439edf8139@x30g2000hsd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have the following table:

Objeto Valor

ob1 10
ob1 20
ob2 50
ob2 10
ob3 50

With the following command:

"select distinct Objeto, sum(valor) from tb
group by Objeto;"

I have to return:

Objeto Valor

ob1 30
ob2 60
ob3 50

What you need to do is add ob2 and ob3 in one field,
Leading me the following table:

Objeto Valor

ob1 30
ob2e3 110

It can do this only with Select?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2008-02-27 14:11:10 Re: An idea for parallelizing COPY within one backend
Previous Message Alvaro Herrera 2008-02-27 13:53:28 Re: Required make version