Michael Fuhr wrote:
On Mon, Nov 13, 2006 at 07:29:09PM +0500, imad wrote:
max (timestamptz, timestamptz) does not exist already. You need to
create a simple function in PLpgSQL something like
if a b
return a;
else
return b;
Since PostgreSQL 8.1 you can use GREATEST:
test= SELECT
I tried the following query but the query fails as
function max (timestamp w. timezone,timestamp w. timezone) does not exist
SELECT id,
MAX(last_updated,
(SELECT MAX (last_updated) FROM product_category_member WHERE
product_category_member.id = product_category.id))
FROM product_category
am Mon, dem 13.11.2006, um 13:46:00 + mailte T E Schmitz folgendes:
I tried the following query but the query fails as
function max (timestamp w. timezone,timestamp w. timezone) does not exist
SELECT id,
MAX(last_updated,
(SELECT MAX (last_updated) FROM product_category_member WHERE
max (timestamptz, timestamptz) does not exist already. You need to
create a simple function in PLpgSQL something like
if a b
return a;
else
return b;
Even an sql function will do the job here using case statement.
--Imad
www.EntepriseDB.com
On 11/13/06, A. Kretschmer [EMAIL PROTECTED]
On Mon, Nov 13, 2006 at 07:29:09PM +0500, imad wrote:
max (timestamptz, timestamptz) does not exist already. You need to
create a simple function in PLpgSQL something like
if a b
return a;
else
return b;
Since PostgreSQL 8.1 you can use GREATEST:
test= SELECT greatest(1, 2);
greatest