can a function take a column name or is there another solution

Поиск
Список
Период
Сортировка
От Mark King
Тема can a function take a column name or is there another solution
Дата
Msg-id BANLkTimc=jekwHNkhE4-eVZwEzHbyx5hTA@mail.gmail.com
обсуждение исходный текст
Ответы Re: can a function take a column name or is there another solution  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Maximilian Tyrtania
Дата:
Сообщение: Re: Can a client connection set variables on the server-side?
Следующее
От: "Oliveiros d'Azevedo Cristina"
Дата:
Сообщение: Re: can a function take a column name or is there another solution