From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | "Magnus Naeslund(f)" <mag(at)fbab(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: 7.4 Wishlist |
Date: | 2002-12-03 05:27:03 |
Message-ID: | 200212030527.gB35R4o22434@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-advocacy pgsql-general pgsql-hackers |
Magnus Naeslund(f) wrote:
> Good!
> Now convert this query so that it only evaluates the date_part thing
> ONCE:
>
> select t.id, date_part('days',now()-t.stamp) from table_name t where
> date_part('days',now()-t.stamp) > 20;
>
> I hope you all are kidding me in not seeing the real issue i'm trying to
> show here.
>
> Cheers
> Magnus
>
>
>
Does this work?
SELECT t.id, x.date_part
FROM table_name t, (select date_part('days',now()-t.stamp)) as x
WHERE x.date_part > 20;
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2002-12-03 05:28:39 | Re: 7.4 Wishlist |
Previous Message | Christopher Kings-Lynne | 2002-12-03 05:20:17 | Re: 7.4 Wishlist |
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2002-12-03 05:28:39 | Re: 7.4 Wishlist |
Previous Message | Christopher Kings-Lynne | 2002-12-03 05:20:17 | Re: 7.4 Wishlist |
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2002-12-03 05:28:39 | Re: 7.4 Wishlist |
Previous Message | Christopher Kings-Lynne | 2002-12-03 05:20:17 | Re: 7.4 Wishlist |