X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 393FF56A1D for ; Thu, 17 Mar 2005 11:43:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98949-05 for ; Thu, 17 Mar 2005 11:43:03 +0000 (GMT) Received: from mail.greatgulfhomes.com (mail.greatgulfhomes.com [216.191.52.66]) by svr1.postgresql.org (Postfix) with ESMTP id B096A56A19 for ; Thu, 17 Mar 2005 11:43:01 +0000 (GMT) Received: from [10.243.102.72] ([216.191.52.74]) (authenticated bits=0) by mail.greatgulfhomes.com (8.12.8/8.12.8) with ESMTP id j2HBxwah015077; Thu, 17 Mar 2005 06:59:58 -0500 Message-ID: <42396D61.6070002@ashtonwoodshomes.com> Date: Thu, 17 Mar 2005 06:43:29 -0500 From: Terry Fielder User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chandan_Kumaraiah Cc: pgsql-sql@postgresql.org Subject: Re: query References: <2EB549AAAFEA264FA926269A5BD5E9EB146579@certsrv.satyam.com> In-Reply-To: <2EB549AAAFEA264FA926269A5BD5E9EB146579@certsrv.satyam.com> Content-Type: multipart/alternative; boundary="------------000503030000040703070200" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.09 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200503/237 X-Sequence-Number: 20716 This is a multi-part message in MIME format. --------------000503030000040703070200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit now() returns a timestamp. Cast it to a date and then you can subtract days. e.g. select now()::date -1 Terry Chandan_Kumaraiah wrote: > > > *Hi,* > > * * > > *In oracle we write sysdate-1* > > *For example,we write a query (select * from table1 where > created_date>=sysdate-1).Whats its equivalent in postgre?* > > * * > > *Chandan* > > * * > -- Terry Fielder terry@greatgulfhomes.com Associate Director Software Development and Deployment Great Gulf Homes / Ashton Woods Homes Fax: (416) 441-9085 --------------000503030000040703070200 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit now() returns a timestamp.

Cast it to a date and then you can subtract days. e.g.

select now()::date -1

Terry

Chandan_Kumaraiah wrote:

 

Hi,

 

In oracle we write sysdate-1

For example,we write a query (select * from table1 where created_date>=sysdate-1).Whats its equivalent in postgre?

 

Chandan

 


-- 
Terry Fielder
terry@greatgulfhomes.com
Associate Director Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
Fax: (416) 441-9085
--------------000503030000040703070200--