S
S
Shazel2015-01-14 12:05:37
MySQL
Shazel, 2015-01-14 12:05:37

Sql query to rename table?

In general, it is necessary to change the link from http to https in all cells. I used to download the database, open it in the sublime, do replace all, and upload it back. But now on the phone.
In general throw sql pls.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Nalomenko, 2015-01-14
@nalomenko

UPDATE table SET url = REPLACE(url, 'http://', 'https://')

If in the entire table and in all fields, then something like this:
select concat(
       'UPDATE table_name SET ',
       column_name,
       ' = REPLACE(', column_name, ', ''http://'', ''https://'');')
from information_schema.columns
where table_name = 'my_table';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question