Re: Function in selection?

Поиск
Список
Период
Сортировка
От Dousak "May (Phoebus Apollonus)
Тема Re: Function in selection?
Дата
Msg-id 1047592282.1833.45.camel@Grandis
обсуждение исходный текст
Ответ на Re: Function in selection?  (Jean-Luc Lachance <jllachan@nsd.ca>)
Список pgsql-general
One more problem :)

I wrote my tables and variables and it looks like that:

SELECT CASE WHEN cena=0 AND cenaeur<>0 THEN cena=cenaeur
*(SELECT eur FROM devizni ORDER BY eur OFFSET 20 LIMIT 1)
 ELSE cena END AS cena, CASE WHEN cenaeur=0 AND cena<>0
THEN cenaeur=cena/(SELECT eur FROM devizni ORDER BY eur
OFFSET 20 LIMIT 1) ELSE cenaeur END AS cena_eur from oglasi
ORDER BY posr, id_regije;

cena, cenaeur and eur are all double precision.

When I try to execute it, I get following error:

ERROR:  CASE types "float8" and "bool" not matched

I have no boolean in neither table... ok, comparision is binary,
but why do I get that error?
What can I do to make it work? :/

Tnx,

May





В списке pgsql-general по дате отправления:

Предыдущее
От: Petre Scheie
Дата:
Сообщение: Re: PL/Java (was: stored procedures)
Следующее
От: Joe Conway
Дата:
Сообщение: Re: PL/Java (was: stored procedures)