how to change all records of a specific field in mysql
I have a table topMovies containing 100,000 records. Table fields are Id, name, movieId and year. Data in movieId field are stored like (/title/tt0111161/, ...), also in the field "year", data are inside parentheses for example (2008) instead of 2008.
Could someone kindly help me how I can change them to tt0111161 and 2008? (I mean deleting other characters like /title/ for movieId and () for year?
Thanks a lot,
UPDATE topMovies SET movieId = REPLACE(REPLACE(movieId,'/title/',''),'/',''), year = REPLACE(REPLACE(year,'(',''), ')','')
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]