Although without UPDATE it finds only 80k lines, in which it is necessary to make a REPLACE
Then I do not see a problem if you have a local database. Make a request of the form:
SELECT CONCAT('UP DATE Detailinfo SET Id=''',REPLACE(Id, '"', '') ,'''WHERE Id=''',Id,'''') FROM Detailinfo WHERE name LIKE '%"%'
Get 80 lines of the form:
UPDATE Detailinfo SET Id='jennifer lopez'WHERE Id='""jennifer lopez""' UPDATE Detailinfo SET Id='ray liotta'WHERE Id='"ray" "liotta"' UPDATE Detailinfo SET Id='samuel l. jackson'WHERE Id='"samuel" l. "jackson"'
Then copy them and run.
Most likely, if there are only 80 lines, you can neatly write UPDATE with WHERE, but you need to look at the real data than the server doesn’t like simple UPDATE with WHERE.
UPD: stop 80k lines? Then a little bit will not work :)
Can I somehow cut the request for portions?
Try this query:
SELECT CONCAT('' ,'UP DATE Detailinfo SET Id=REPLACE(Id, ''"'', '''')' ,'WHERE Id BETWEEN ''', MIN(Id), ''' AND ''', MAX(Id) ,''' AND Id LIKE ''%"%''' )QRY FROM( SELECT Id, @I := @I+1 AS N ,1000000 AS K --тут задайте нужное значение K FROM Detailinfo, (SELECT @I := -1)I ORDER BY Id )T GROUP BY NN%K
He will return you 850 dml UPDATE requests of the form:
UPDATE Detailinfo SET Id=REPLACE(Id, '"', '')WHERE Id BETWEEN 'alan rickman' AND 'gary oldman' AND Id LIKE '%"%' UPDATE Detailinfo SET Id=REPLACE(Id, '"', '')WHERE Id BETWEEN 'george clooney' AND 'michael caine' AND Id LIKE '%"%' UPDATE Detailinfo SET Id=REPLACE(Id, '"', '')WHERE Id BETWEEN 'michael douglas' AND 'steve martin' AND Id LIKE '%"%' UPDATE Detailinfo SET Id=REPLACE(Id, '"', '')WHERE Id BETWEEN 'sylvester stallone' AND 'tommy lee jones' AND Id LIKE '%"%'
Each of which will process a pack of 1 million. rows, pack size can be changed by setting the K parameter in the query.
How it works: sorts all the rows in the order of Id, numbers. Then it groups each pack (K pieces), finds the minimum and maximum Id values, and generates the corresponding. DML request.
Since Id has an index, it should be executed normally. If you put K = 10 million. receive 85 DML requests.
UPDATE... WHERE id like '%"%' LIMIT 0, 1000- BOPOHWHEREalready tried, hangs anyway. The feeling thatWHEREperforms is not the first. ps Although withoutUPDATEfinds only 80k lines in which it is necessary to doREPLACE. - Zhenya40