Consider that there are two schemas named test1 and test2 in the database and you want
to move tables from schema test1 to test2.
Let’s create a table in schema test1.
In the above query, we have also run a query to know which schema the table test belongs to.
create table test1.test(id int, names varchar(100))
select * from information_schema.tables where TABLE_NAME='test'
As you can see, the schema of the table is test1
Now run the following query to move table test from schema test1 to test2
Again run the following statement to know which schema the table test now belongs to
SELECT * from information_schema.tables where TABLE_NAME='test'
As you see from the result, the schema of table has now changed from test1 to test2
No comments:
Post a Comment