Skip site navigation (1) Skip section navigation (2)

Boolean SQL function ?

From: Bo Lorentsen <bl(at)netgroup(dot)dk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Boolean SQL function ?
Date: 2001-08-22 13:02:45
Message-ID: 3B83AD75.91744798@netgroup.dk (view raw or flat)
Thread:
Lists: pgsql-novice
Hi ...

This time I'm really lost :-)

How does one write a SQL FUNCTION that works in a WHERE clause ?

If fx. I like to make a function called "is_today" that take two dates
and test if they are within the same day, how can I express this in SQL
?

I cant make a "SELECT 1 WHERE EXTRACT( day ...", so how does one return
a boolean ?

Hopefull regards ..

/BL


Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2001-08-22 14:31:09
Subject: Re: Boolean SQL function ?
Previous:From: Bo LorentsenDate: 2001-08-22 12:34:58
Subject: Re: Subquery and where clause ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group