can a function take a column name or is there another solution - Mailing list pgsql-novice

From Mark King
Subject can a function take a column name or is there another solution
Date
Msg-id BANLkTimc=jekwHNkhE4-eVZwEzHbyx5hTA@mail.gmail.com
Whole thread Raw
Responses Re: can a function take a column name or is there another solution
List pgsql-novice
I have a table with sampledate, meter1, meter2...etc

I am trying to develop a function or query 

where:

select sampledate, (meter1 - (select meter1 where sampledate = sampledate + interval '1 days')) as consumption from mytable;



Any ideas how to make this work?


Mark King

pgsql-novice by date:

Previous
From: Maximilian Tyrtania
Date:
Subject: Re: Can a client connection set variables on the server-side?
Next
From: "Oliveiros d'Azevedo Cristina"
Date:
Subject: Re: can a function take a column name or is there another solution