Re: Max/min of 2 values function, plpgsql efficency?

From: "Bas Scheffers" <bas(at)scheffers(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Subject: Re: Max/min of 2 values function, plpgsql efficency?
Date: 2004-03-02 17:30:32
Message-ID: 1320.217.205.40.94.1078248632.squirrel@io.scheffers.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just use the CASE statment, example:

create table test (foo int, bar int);
insert into test2 values (1, 2);
insert into test2 values (4, 3);

select case when foo > bar then foo else bar end from test2;

Bas.

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-03-02 17:38:28 Re: max table size
Previous Message Bruno Wolff III 2004-03-02 17:02:47 Re: Database metadata queries (WAS Re: Moving from MySQL to PGSQL....some questions)