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

Поиск
Список
Период
Сортировка
От Oliveiros d'Azevedo Cristina
Тема Re: can a function take a column name or is there another solution
Дата
Msg-id 6B57806AD25A4B81A81A7B6EE5889601@marktestcr.marktest.pt
обсуждение исходный текст
Ответ на can a function take a column name or is there another solution  (Mark King <fires10@gmail.com>)
Список pgsql-novice
Hello!
 
I fail to understand what you are attempting to do.
What does your table represent and what output you expect to have..?
 
To my best knowledge this  (select meter1 where sampledate = sampledate + interval '1 days') is not valid SQL so could you please explain in english the info
you want to obtain from your table?
 
 
Best,
Oliveiros
 
----- Original Message -----
From: Mark King
Sent: Monday, April 18, 2011 4:16 PM
Subject: [NOVICE] can a function take a column name or is there another solution

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 по дате отправления:

Предыдущее
От: Mark King
Дата:
Сообщение: can a function take a column name or is there another solution
Следующее
От: Tom Lane
Дата:
Сообщение: Re: can a function take a column name or is there another solution