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 General > Extract only nu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15467 of 16015
Post > Topic >>

Extract only numbers from a varchar column

by mateamargo@[EMAIL PROTECTED] ("Leandro Casadei") May 5, 2008 at 02:08 PM

------=_Part_19753_18722956.1210007336095
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I need to extract only the first occurence of numbers from a column  that
is
varchar.

Here are a few examples of what I need to do:

abc200xx -> 200
340ppsdd -> 340
150ytyty555 -> 150

Can this be done by a simple query or do I need to use a cursor?

Thanks

------=_Part_19753_18722956.1210007336095
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<p>I need to extract only the first occurence of numbers from a column
&nbsp;that is varchar.</p><p>Here are a few examples of what I need to
do:</p><p>abc200xx -&gt; 200<br>340ppsdd -&gt; 340<br>150ytyty555 -&gt;
150<br></p><p>
Can this be done by a simple query or do I need to use a
cursor?</p><p>Thanks</p>

------=_Part_19753_18722956.1210007336095--
 




 3 Posts in Topic:
Extract only numbers from a varchar column
mateamargo@[EMAIL PROTECT  2008-05-05 14:08:55 
Re: Extract only numbers from a varchar column
mateamargo@[EMAIL PROTECT  2008-05-05 16:09:56 
Re: Extract only numbers from a varchar column
bopolissimus.lists@[EMAIL  2008-05-10 20:54:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan13V112 Tue Jul 8 23:57:41 CDT 2008.