Skip site navigation (1) Skip section navigation (2)

Data conversion in query

From: Tad Marko <tad(at)tadland(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Data conversion in query
Date: 2003-03-27 19:43:10
Message-ID: (view raw or whole thread)
Lists: pgsql-general

I'm having a small difficulty that I am hopeful there is a simple solution 
for. Basically, I am doing a join on a column that is numeric in one 
database but a string in the other. Something like:

...WHERE a.numeric_zipcode=b.string_zipcode::integer...

The problem is that occasionally the string zip field has some 
non-numeric characters. Unfortunatley, I cannot control the sanity of the 
string zip field. The question is if there is any way that in the same 
query I can filter out the rows that have non-number characters in the zip 

Thanks for any thoughts,



pgsql-general by date

Next:From: Doug McNaughtDate: 2003-03-27 19:56:14
Subject: Re: Data conversion in query
Previous:From: Tom LaneDate: 2003-03-27 19:34:50
Subject: Re: Possible bug in date(timestamptz)?

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group