Re: [SQL] help on select

2011-04-21 Thread Jasen Betts
On 2011-04-20, Saulo VenĂ¢ncio wrote: > --bcaec52e65e9b2f22304a15f3840 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > > Hi guys, > I need your help. > I have a table called medidas, in this table i have some ocurrences that ha= > s > id_medida(primary

Re: [SQL]

2011-04-21 Thread Tom Lane
Humair Mohammed writes: > I am running into a behavior with a postgresql function with a SETOF > refcursor's returning multiple columns. Not sure if there is a different way > to retrieve a SETOF refcursor's with variable columns? Alternatively can I > return a primitive value and a refcursor f

Re: [SQL] help on select

2011-04-21 Thread Charlie
You might try: WITH pontos AS ( SELECT column1 AS idponto FROM (VALUES (10), (11), (23), (24) ) AS a ), subset AS ( SELECT b.idponto, date_trunc('day', datetime) AS datetime FROM medidas b INNER JOIN pontos USING(idponto) GROUP BY b.idponto, date_trunc('day', da