Originally posted by Anand Loni:
Hi,
I have two tables, in first table Column Country is defined as VarChar, and in another table column Country is number. I have predefined set of Country names that will go in first table like US, FR etc and each country is given some number like US is 0, FR is 1.
My problem is, I am writing a query where I am finding data from second table with same Country. Here I should convert value US to 0, FR to 1 etc.
How should I write query that will replace country value with number ?
Regards,
Anand
Oracle use
to_number(varchar column here)
PostgreSQL/DB2/MySQL
cast(varchar column here AS newDataTypeHere)
[ October 18, 2007: Message edited by: Paul Campbell ]