From narendraa@subexgroup.com Mon Jul 8 17:36:24 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 227FC476AFA for ; Mon, 8 Jul 2002 13:36:24 -0400 (EDT) Mailbox-Line: From narendraa@subexgroup.com Mon Jul 8 13:36:24 2002 Received: from subexgroup.com (unknown [164.164.82.29]) by postgresql.org (Postfix) with ESMTP id 1CDD84763EC for ; Mon, 8 Jul 2002 10:30:56 -0400 (EDT) Received: from narendraa by subexgroup.com with SMTP (MDaemon.v3.5.0.R) for ; Mon, 08 Jul 2002 19:55:30 +0530 Reply-To: From: "Narendra A" To: Subject: is there a way to get hh:mm:ss given seconds Date: Mon, 8 Jul 2002 19:58:50 +0530 Message-ID: <001f01c2268b$c81ae2b0$19ba10ac@narendraa> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C226B9.E1D31EB0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Return-Path: narendraa@subexgroup.com X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.30 X-Spam-Level: X-Archive-Number: 200207/112 X-Sequence-Number: 8491 This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C226B9.E1D31EB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Sir, Is there a way in sql such that if I give seconds it should me return me hours:mins:seconds Eg. Seconds hh:mm:ss 422 1:01:02 eagerly waiting for response. Regards Narendra DISCLAIMER: This email is bound by the terms and conditions described at http://www.subexgroup.com/mail-disclaimer.htm ------=_NextPart_000_0020_01C226B9.E1D31EB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Sir,

Is there a way in sql such that if I give seconds it should me retur= n me hours:mins:seconds

 <= /span>

Eg. Seconds     = hh:mm:ss

422      =         1:01:02

 <= /span>

eagerly waiting for response.

 <= /span>

Regards

Narendra


DISCLAIMER: This email is bound by the terms and conditions described at http://www.subexgroup.com/mail-disclaimer.htm
------=_NextPart_000_0020_01C226B9.E1D31EB0-- From devin@spamcop.net Tue Jul 9 15:19:30 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 4AA8E475F29 for ; Tue, 9 Jul 2002 11:19:30 -0400 (EDT) Mailbox-Line: From devin@spamcop.net Tue Jul 9 11:19:30 2002 Received: from glass.dnsart.com (203.141.139.231.user.ad.il24.net [203.141.139.231]) by postgresql.org (Postfix) with ESMTP id 203AE4764E7 for ; Tue, 9 Jul 2002 10:41:31 -0400 (EDT) Received: from localhost ([127.0.0.1]) by glass.dnsart.com with esmtp (Exim 3.36 #1) id 17RwBB-0001AJ-00; Tue, 09 Jul 2002 23:41:25 +0900 Date: Tue, 9 Jul 2002 23:41:23 +0900 (JST) From: Tod McQuillin X-X-Sender: devin@glass.pun-pun.prv To: Narendra A Cc: pgsql-sql@postgresql.org Subject: Re: is there a way to get hh:mm:ss given seconds In-Reply-To: <001f01c2268b$c81ae2b0$19ba10ac@narendraa> Message-ID: <20020709234014.Y68009-100000@glass.pun-pun.prv> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-3.4 required=5.0 tests=IN_REP_TO version=2.30 X-Spam-Level: X-Archive-Number: 200207/116 X-Sequence-Number: 8495 On Mon, 8 Jul 2002, Narendra A wrote: > Is there a way in sql such that if I give seconds it should me return me > hours:mins:seconds > > Eg. Seconds hh:mm:ss > 422 1:01:02 foo=# select '422 seconds'::interval; interval ---------- 00:07:02 (1 row) -- Tod McQuillin From david@stanaway.net Tue Jul 9 14:58:45 2002 Received: from ciderbox.stanaway.net (ciderbox.stanaway.net [170.76.50.98]) by postgresql.org (Postfix) with ESMTP id 4C6634775FA for ; Tue, 9 Jul 2002 10:58:45 -0400 (EDT) Received: by ciderbox.stanaway.net (Postfix, from userid 1000) id 03860929A2; Tue, 9 Jul 2002 09:58:17 -0500 (CDT) Subject: Re: is there a way to get hh:mm:ss given seconds From: David Stanaway To: narendraa@subexgroup.com Cc: pgsql-sql@postgresql.org In-Reply-To: <001f01c2268b$c81ae2b0$19ba10ac@narendraa> References: <001f01c2268b$c81ae2b0$19ba10ac@narendraa> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-QBKc/KhhYv52wciYuYo4" X-Mailer: Ximian Evolution 1.0.7 Date: 09 Jul 2002 09:58:17 -0500 Message-Id: <1026226697.29753.22.camel@ciderbox> Mime-Version: 1.0 X-Archive-Number: 200207/115 X-Sequence-Number: 8494 --=-QBKc/KhhYv52wciYuYo4 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2002-07-08 at 09:28, Narendra A wrote: > Sir, > Is there a way in sql such that if I give seconds it should me return me > hours:mins:seconds >=20 > Eg. Seconds hh:mm:ss > 422 1:01:02 scratch=3D# SELECT 422::interval; interval=20 ---------- 00:07:02 (1 row) scratch=3D# \q dstanawa@ciderbox:~$ bc -l 7*60+2 422 I don't know where you got 1:01:02 from. -- David Stanaway --=-QBKc/KhhYv52wciYuYo4 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iQEXAwUAPSr6Cb6yIDFGeSAyFAKrQAP/fYud73NSOB5yEJGzvGN30aB7ZiTszWn6 9MDaiECmIKy9XSg8bGkikZCY/acgS0Ww7K3R55n/0kW3a1KWqnqhnLc1gdX54Tok 7BGqA0vmmiz9KGaA3D9KypGc7OOVol0QAUjWskafwc9XxoWY7jN4xnxDUcNSVZRW vb/mHaTOzrgEAMBPpvj0qQgw1t8LF4JvLJzYpkOTXYFhqgyjgRjPpvSI/IVs8qyC FXE1CATDMdI16s2i9E2MZcalh5UHWV1wvuqmBFg44eUjpJSt1o1RXR11ojYAspdL NosrbjX00t2h9v583xH1qMYaitXA1KqBaUrrQeJ9bWQcNyBsPY33/yIk =qBHN -----END PGP SIGNATURE----- --=-QBKc/KhhYv52wciYuYo4-- From kevinb@nurseamerica.net Tue Jul 9 19:11:22 2002 Received: from dilbert.nurseamerica.net (unknown [207.53.237.114]) by postgresql.org (Postfix) with ESMTP id BD37B475982 for ; Tue, 9 Jul 2002 15:11:22 -0400 (EDT) Received: from nurseamerica.net (archimedes.myrdin.net [206.176.158.41]) by dilbert.nurseamerica.net (8.11.6/8.11.6) with ESMTP id g69JBNj12946 for ; Tue, 9 Jul 2002 14:11:23 -0500 Message-ID: <3D2B3559.90906@nurseamerica.net> Date: Tue, 09 Jul 2002 14:11:21 -0500 From: Kevin Brannen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: is there a way to get hh:mm:ss given seconds References: <20020709234014.Y68009-100000@glass.pun-pun.prv> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/122 X-Sequence-Number: 8501 Tod McQuillin wrote: > On Mon, 8 Jul 2002, Narendra A wrote: > > >>Is there a way in sql such that if I give seconds it should me return me >>hours:mins:seconds >> >>Eg. Seconds hh:mm:ss >>422 1:01:02 > > > foo=# select '422 seconds'::interval; > interval > ---------- > 00:07:02 > (1 row) That works on inserts into a "time" field too, cool tip. THANKS! Kevin From josh@agliodbs.com Wed Jul 10 05:46:51 2002 Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 05950475B5F for ; Wed, 10 Jul 2002 01:46:51 -0400 (EDT) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1571826; Tue, 09 Jul 2002 22:46:49 -0700 From: "Josh Berkus" Subject: Re: is there a way to get hh:mm:ss given seconds To: Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Tue, 09 Jul 2002 22:46:49 -0700 Message-ID: In-Reply-To: <000001c227c7$80d8eb30$19ba10ac@narendraa> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200207/126 X-Sequence-Number: 8505 Narendra, > I tried all these. This is what I get > SQL> SELECT "interval"(cast(422 as varchar) || ' seconds'); > SELECT "interval"(cast(422 as varchar) || ' seconds') > * > ERROR at line 1: > ORA-00906: missing left parenthesis > SQL> select '422 seconds'::interval; > select '422 seconds'::interval > * > ERROR at line 1: > ORA-00923: FROM keyword not found where expected Those don't look like PostgreSQL error messages. I think you are using some other database. -Josh Berkus From chriskl@familyhealth.com.au Wed Jul 10 05:49:37 2002 Received: from houston.familyhealth.com.au (i231-006.nv.iinet.net.au [203.59.231.6]) by postgresql.org (Postfix) with ESMTP id E445647596A for ; Wed, 10 Jul 2002 01:49:37 -0400 (EDT) Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id g6A5nZl49983 for pgsql-sql@postgresql.org; Wed, 10 Jul 2002 13:49:35 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id g6A5nXV49849; Wed, 10 Jul 2002 13:49:33 +0800 (WST) From: "Christopher Kings-Lynne" To: "Josh Berkus" , Cc: Subject: Re: is there a way to get hh:mm:ss given seconds Date: Wed, 10 Jul 2002 13:49:43 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200207/127 X-Sequence-Number: 8506 > > I tried all these. This is what I get > > SQL> SELECT "interval"(cast(422 as varchar) || ' seconds'); > > SELECT "interval"(cast(422 as varchar) || ' seconds') > > * > > ERROR at line 1: > > ORA-00906: missing left parenthesis > > > SQL> select '422 seconds'::interval; > > select '422 seconds'::interval > > * > > ERROR at line 1: > > ORA-00923: FROM keyword not found where expected > > Those don't look like PostgreSQL error messages. I think you are using > some other database. Yes - he's using Oracle. I think Narendra is rather confused... Chris