Advertisement
Guest User

Untitled

a guest
Nov 29th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. INSERT INTO testDB.category_to_website (category_01_id)
  2. SELECT t4.id
  3. FROM testDB.websites t2
  4. JOIN mainDB.websites t3 ON t2.url = t3.url
  5. JOIN testDB.category_01 t4 ON t3.category2 = t4.name
  6. WHERE t2.url = t3.url
  7.  
  8. UPDATE testDB.category_to_website
  9. JOIN testDB.websites t2 ON t2.url = mainDB.websites.url
  10. JOIN mainDB.websites t3 ON t2.url = t3.url
  11. JOIN testDB.category_01 t4 ON t3.category2 = t4.name
  12. SET t4.id=category_01_id
  13. WHERE t2.url = t3.url
  14.  
  15. Update t4 set t4.id=t6.category_01_id from testDB.category_01 t4 as t4
  16. inner join testDB.websites t2 ON t2.url = mainDB.websites.url
  17. inner join mainDB.websites t3 ON t2.url = t3.url
  18. inner join testDB.category_01 t5 ON t3.category2 = t5.name
  19. inner join testDB.category_to_website t6 on t4.ID=t6.category_01_id
  20. WHERE t2.url = t3.url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement