I have a zipcode field in my table and I allow the following formats for zipcodes:4958349584-3949well some of the current zip codes look like this:495843949it needs a dash (-) in between it. I wrote this query to do so, BUT i don't know how to make it apply to the current row its selecting from. here:update contacts set zip = (select substring(zip, 1, 5)+'-'+substring(zip, 6, 4)from contacts where zip not like '%-%' and len(zip) >5) where --then what?
I tried a subquery selecting the zip but its not working. Any help would be greatly appreciated.Thanks!