Guest User

Untitled

a guest
Apr 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.82 KB | None | 0 0
  1. INSERT IGNORE INTO user_remote_site_accounts (user_id,service_type,login,pass,date_created)
  2. SELECT user_id, service_type, login, pass, date_create FROM
  3.  
  4. (SELECT MAX(id) AS maxid,
  5. CASE
  6. WHEN url REGEXP 'fileserve'=1 THEN 'fileserve'
  7. WHEN url REGEXP 'filesonic'=1 THEN 'filesonic'
  8. WHEN url REGEXP 'megaupload'=1 THEN 'megaupload'
  9. WHEN url REGEXP 'rapidshare'=1 THEN 'rapidshare'
  10. WHEN url REGEXP 'oron'=1 THEN 'oron'
  11. WHEN url REGEXP 'depositfiles'=1 THEN 'depositfiles'
  12. ELSE 'default'
  13. END AS service_type
  14. FROM user_premium_accounts
  15. WHERE url LIKE  '%depositfiles%'
  16. OR url LIKE  '%fileserve%'
  17. OR url LIKE  '%filesonic%'
  18. OR url LIKE  '%oron%'
  19. OR url LIKE  '%rapidshare%'
  20. OR url LIKE  '%megaupload%'
  21. GROUP BY user_id, service_type
  22. ) AS tab1
  23. JOIN user_premium_accounts upa ON tab1.maxid = upa.id
  24. GROUP BY user_id, service_type
Add Comment
Please, Sign In to add comment