dcrespo wrote:
SELECT
CASE WHEN is_odd(t.number) THEN 'Update' ELSE 'Insert' END AS
action,
CASE WHEN is_odd(t.number) THEN t.number ELSE NULL END AS number,
FROM ... ;
As you can see, is_odd function (only a function example) is being run
twice with exactly the same parameters to put a
On Apr 12, 4:30 pm, [EMAIL PROTECTED] (Tom Lane) wrote:
> "dcrespo" <[EMAIL PROTECTED]> writes:
> > They are exactly the same, that's why I want to evaluate it only once
> > and, depending on it, put the corresponding value into two different
> > fields that must be returned, instead of evaluating
"dcrespo" <[EMAIL PROTECTED]> writes:
> They are exactly the same, that's why I want to evaluate it only once
> and, depending on it, put the corresponding value into two different
> fields that must be returned, instead of evaluating once for each
> field. Any insight?
There's no solution that wo
On Apr 11, 11:35 pm, [EMAIL PROTECTED] (Guy Rouillier) wrote:
> dcrespo wrote:
> > Hi everybody,
>
> > I'm implementing something like this:
>
> > SELECT
> > CASE WHEN add_numbers(t1.main_number,t2.main_number)>100
> > THEN t1.description1
> > ELSE t2.description1
> > END AS
dcrespo wrote:
Hi everybody,
I'm implementing something like this:
SELECT
CASE WHEN add_numbers(t1.main_number,t2.main_number)>100
THEN t1.description1
ELSE t2.description1
END AS number_description1,
CASE WHEN add_numbers(t1.main_number,t2.main_number)>100
T
Hi everybody,
I'm implementing something like this:
SELECT
CASE WHEN add_numbers(t1.main_number,t2.main_number)>100
THEN t1.description1
ELSE t2.description1
END AS number_description1,
CASE WHEN add_numbers(t1.main_number,t2.main_number)>100
THEN t1.descriptio