Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > FW: Re: Part 1 ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 3364 of 3799
Post > Topic >>

FW: Re: Part 1 of several - Converting a varchar to an interval

by aklaver@[EMAIL PROTECTED] (Adrian Klaver) Mar 26, 2008 at 04:32 PM

-------------- Forwarded Message: --------------
From: aklaver@[EMAIL PROTECTED]
 (Adrian Klaver)
To: Shawn <postgres@[EMAIL PROTECTED]
>
Subject: Re: [SQL] Part 1 of several - Converting a varchar to an interval
Date: Wed, 26 Mar 2008 16:16:58 +0000
> 
> 
> 
> 
>  -------------- Original message ----------------------
> From: Shawn <postgres@[EMAIL PROTECTED]
>
> > Hello,
> > 
> > I have several large tables, over 100 million records each.  One of
the fields 
> > is callee 'duration'.  It is a varchar that contains what is
essentially an 
> > integer that is the duration of an event in milleseconds.  Could
someone tell 
> > me a simple way to convert a value such as 134987 stored in a varchar
into an 
> > interval?
> > 
> > This will dovetail with my next question. 
> > 
> > Thanks for all the help both now and previous.
> > 
> > Shawn
> > 
> 
select ('134987'::int/1000.00) * interval ' 1 second' ;
    ?column?
 --------------
  00:02:14.987
 (1 row)
 
 


Forgot to Reply All.
--
Adrian Klaver
aklaver@[EMAIL PROTECTED]
 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 8 Posts in Topic:
FW: Re: Part 1 of several - Converting a varchar to an interval
aklaver@[EMAIL PROTECTED]  2008-03-26 16:32:34 
Re: FW: Re: Part 1 of several - Converting a varchar to an inter
tgl@[EMAIL PROTECTED] (T  2008-03-26 13:14:28 
Re: FW: Re: Part 1 of several - Converting a varchar to an inter
postgres@[EMAIL PROTECTED  2008-03-26 22:45:53 
Re: FW: Re: Part 1 of several - Converting a varchar to an inter
rdeleonp@[EMAIL PROTECTED  2008-03-26 18:12:07 
Re: FW: Re: Part 1 of several - Converting a varchar to an inter
postgres@[EMAIL PROTECTED  2008-03-26 23:41:38 
Dropping Functions
postgres@[EMAIL PROTECTED  2008-03-27 00:05:48 
Re: Dropping Functions
aklaver@[EMAIL PROTECTED]  2008-03-26 17:13:26 
Re: Dropping Functions
postgres@[EMAIL PROTECTED  2008-03-27 00:25:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 22:28:26 CST 2008.