Re: Function in selection? - Mailing list pgsql-general

From Dousak "May (Phoebus Apollonus)
Subject Re: Function in selection?
Date
Msg-id 1047596493.1832.51.camel@Grandis
Whole thread Raw
In response to Re: Function in selection?  (Jean-Luc Lachance <jllachan@nsd.ca>)
List pgsql-general
Cool, this works, thanks!!

I remembered one more thing... I promise this is the last one :)

Both tables have date entries; how can I replace OFFSET 20 with "where
date <= date from current record from oglasi"? :/ I know, I know, I'm
terrible...sorry :/

Tnx,

May


> There is no need for the assignment in the then clause.

> SELECT CASE WHEN cena=0 THEN
> cenaeur*(SELECT eur FROM devizni ORDER BY eur OFFSET 20 LIMIT 1)
> ELSE cena END AS cena,
> CASE WHEN cenaeur=0 THEN
> 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;



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: functional indexes and their costs
Next
From: Marcin Owsiany
Date:
Subject: ~*, case insensitiveness and national chars