Table of Content

Замінити значення у всіх таблицях одним запитом

SELECT
    CONCAT('UPDATE ', table_schema, '.', table_name, ' SET ', column_name, '=REPLACE(', column_name, ',''glutamine.'',''l-glutamine.'');')
FROM
    information_schema. COLUMNS
WHERE
    table_schema IN ('your_database_name')
    -- AND table_name NOT IN ('table_name') -- exclude table names
AND (
    column_type LIKE 'char(%'
    OR column_type LIKE 'varchar(%'
    OR column_type LIKE '%text'
);
Last modified: 09.10.2018

Author

Comments

Write a Reply or Comment

Your email address will not be published.