How do I do a dynamic - select now() + interval X days ?
How do I do a dynamic - select now() + interval X days ?
От:
"Abraham, Danny" <danny_abraham@bmc.com>
Дата:
Thanks Danny Abraham BMC Software CTM&D Business Unit 972-52-4286-513 danny_abraham@bmc.com
Re: How do I do a dynamic - select now() + interval X days ?
От:
Jon Sime <jsime@mediamatters.org>
Дата:
Abraham, Danny wrote:
> Thanks
For doing that based on an arbitrary value, just do the following:
select now() + interval '1 day' * X;
-Jon
--
Senior Systems Developer
Media Matters for America
http://mediamatters.org/
Re: How do I do a dynamic - select now() + interval X days ?
От:
Kristo Kaiv <kristo.kaiv@skype.net>
Дата:
On 08.08.2007, at 18:16, Jon Sime wrote:
Abraham, Danny wrote:ThanksFor doing that based on an arbitrary value, just do the following:select now() + interval '1 day' * X;-Jon
test=# select (3||' day')::interval;
interval
----------
3 days
(1 row)
--Senior Systems DeveloperMedia Matters for America---------------------------(end of broadcast)---------------------------TIP 9: In versions below 8.0, the planner will ignore your desire tochoose an index scan if your joining column's datatypes do notmatch
Kristo Kaiv
http://kaiv.wordpress.com (PostgreSQL blog)