I misunderstood, I thought you were looking for a way of converting your 
numbers-as-strings into a native numeric format. 

Please describe you situation better: What language are you using to build 
your application. Are you composing the SQL statement client-side or 
server-side? What kind of SQL statement are you trying to execute?

Your table structures (the output of SHOW CREATE TABLE ...  works very 
well) and some sample data would also help.

Sorry for the confusion!

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Test USER <[EMAIL PROTECTED]> wrote on 12/09/2005 04:28:44 PM:

> Hello, thanks for your help!
> I dont really get it :)
> 
> You suggestion is to have a seperate column with the name numericvalue 
and 
> insert userinput into that and add a zero, right?
> 
> Could you explain more, why when how will this help me :)
> 
> Quoting [EMAIL PROTECTED]:
> 
> > Assuming that your text data is in the column `userinput` and you want
> > the 
> > integer values to be in the column `numericvalue`, this statement will 

> > populate the `numericvalue` column all at once:
> > 
> > UPDATE `odd_data_table` SET `numericvalue` = `userinput` + 0;
> > 
> > You are better off checking for type-correctness before you enter data 

> > into the database than you are trying to correct it after the input. 
> > However, I have had to do just this kind of conversion on many 
occasions
> > 
> > (old data, bad batch inputs, text file bulk loads, etc.)  so I know 
> > techniques like this still have their place.
> > 
> > Shawn Green
> > Database Administrator
> > Unimin Corporation - Spruce Pine
> > 
> > Test USER <[EMAIL PROTECTED]> wrote on 12/09/2005 03:30:17 PM:
> > 
> > > in an application i have written there is the need to do a search 
from
> > 
> > mysql 
> > > using numbers that are stored in a varchar column. it is not 
> > > possible to store 
> > > only the results with numbers in a seperate column.
> > > so i was looking at CAST(), is this a big performance loss? is
> > theresome 
> > way 
> > > of benchmarking different queries easy?
> > > 

Reply via email to