Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO testDB.category_to_website (category_01_id)
- SELECT t4.id
- FROM testDB.websites t2
- JOIN mainDB.websites t3 ON t2.url = t3.url
- JOIN testDB.category_01 t4 ON t3.category2 = t4.name
- WHERE t2.url = t3.url
- UPDATE testDB.category_to_website
- JOIN testDB.websites t2 ON t2.url = mainDB.websites.url
- JOIN mainDB.websites t3 ON t2.url = t3.url
- JOIN testDB.category_01 t4 ON t3.category2 = t4.name
- SET t4.id=category_01_id
- WHERE t2.url = t3.url
- Update t4 set t4.id=t6.category_01_id from testDB.category_01 t4 as t4
- inner join testDB.websites t2 ON t2.url = mainDB.websites.url
- inner join mainDB.websites t3 ON t2.url = t3.url
- inner join testDB.category_01 t5 ON t3.category2 = t5.name
- inner join testDB.category_to_website t6 on t4.ID=t6.category_01_id
- WHERE t2.url = t3.url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement