HAVING confusion.. - Mailing list pgsql-sql

From George Henry C. Daswani
Subject HAVING confusion..
Date
Msg-id Pine.LNX.4.04.9902211428480.16742-100000@Vorlon.odc.net
Whole thread Raw
Responses Re: [SQL] HAVING confusion..  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-sql
Hello,

    I'm using postgresql 6.4.2 and i'm having a problem with the
"HAVING" clause..


Basically I do

SELECT u_id,expire_date FROM users HAVING expire_date >= (NOW())

expire_date is of timestamp data type.

and it keeps failing with
ERROR:  This is not a valid having query!

even doing something simple like
SELECT u_id from users having u_id > 5

fails with the same error..

select sell_by_date,item_num FROM sell,users,i
tem WHERE sold_by = u_id AND sell_item = item_num AND category_id =
'$parameter'
 ORDER BY register_date DESC HAVING sell_by_date >= (NOW())

basically I want to do the above that works with great with mysql
, solid and etc..





pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [SQL] Re: questions on interpreting the output of explain\
Next
From: Gregg Berkholtz
Date:
Subject: SQL query _slow_