PDA

View Full Version : Editing part of field in mySQL


Deedee
01-07-2004, 09:25 PM
Hi
I exported an excel database with no number formatting to a comma delimited txt file and imported it into mySQL. The database contains 24000 rekords. For some reason some 3000 odd rekords were imported with .00 decimals. Is there a way through a SQL query that I can delete ONLY the incorrect .00 data from multiple fields? I don't exactly look forward to manually editing 3000 rekords!

Many Thanx!

Deedee
01-07-2004, 11:46 PM
This worked like a charm:

UPDATE mytable SET myfield = ROUND(myfield,0) WHERE myfield LIKE '%.00'

:D