X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1138C9FB321 for ; Thu, 10 Aug 2006 16:22:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 43955-08 for ; Thu, 10 Aug 2006 16:22:03 -0300 (ADT) X-Greylist: delayed 00:06:38.512822 by SQLgrey- Received: from smtp103.mail.mud.yahoo.com (smtp103.mail.mud.yahoo.com [209.191.85.213]) by postgresql.org (Postfix) with SMTP id 4B2E49FB31F for ; Thu, 10 Aug 2006 16:22:02 -0300 (ADT) Received: (qmail 10099 invoked from network); 10 Aug 2006 19:15:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=dcu5bMPnpgD/FFBZ/+xzdkI9/7Dou0azGO857XCkYH/ray/Md5jibXj6uHGeLvtlCsZQNgNiUBTmpruPiYvruCCIAJPtDSgFpyZ99Oy97bliKcuPpbuw6dK90SEmP+F6U/fOZ35jX1NATlPNu5V16wYH87IxNTeJCJmUJuBWMzQ= ; Received: from unknown (HELO ?10.2.200.151?) (osvaldo?kussama@200.155.30.180 with plain) by smtp103.mail.mud.yahoo.com with SMTP; 10 Aug 2006 19:15:21 -0000 Message-ID: <44DB8723.6020401@yahoo.com.br> Date: Thu, 10 Aug 2006 16:21:07 -0300 From: Osvaldo Rosario Kussama User-Agent: Thunderbird 1.5.0.4 (X11/20060614) MIME-Version: 1.0 To: chrisj , pgsql-sql@postgresql.org Subject: Re: date arithmetic References: <5715425.post@talk.nabble.com> In-Reply-To: <5715425.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.361 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200608/68 X-Sequence-Number: 26026 chrisj escreveu: > Hi ALL, > > I want to do date arithmetic in SQL with a column that is integer. > > example > > create table bob ( > col1 timestamp > , col2 int4 > ; > > where col2 represents a number of minutes. > > > I want to do something like > > select col1 + interval col2 minutes > from bob > > This is doable with most other RDBMS (DB2, Oracle MS SQL) what am I > missing?? > > I know one option is to create col2 as interval, but does not work for me. > How can I cast int4 to "interval minutes" SELECT col1 + col2*interval '1 miunute' FROM bob; []s Osvaldo _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com