Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.33 KB | None | 0 0
  1. SELECT t1.server_id,device_info,uid,gender
  2. FROM
  3. (SELECT server_id,device_info
  4. FROM stat_meitu.mtxx_oda_all_user_active_info_new
  5. WHERE date_p = 20191110
  6. AND os_p IN ('ios','android')
  7. AND last_date >= 20180101
  8. GROUP BY server_id,device_info) t1
  9.  
  10. LEFT JOIN
  11.  
  12. (SELECT gid FROM
  13. user_profile.uprofile_oda_install_applist
  14. WHERE date_p = 20191108
  15. AND (concat_ws(',',installed_applist) LIKE '%Tinder%'
  16.         OR concat_ws(',',installed_applist) LIKE '%探探%'
  17.         OR concat_ws(',',installed_applist) LIKE '%陌陌%'
  18.         OR concat_ws(',',installed_applist) LIKE '%积目%'
  19.         OR concat_ws(',',installed_applist) LIKE '%Soul%')
  20. GROUP BY gid) t2
  21. ON t1.server_id = t2.gid
  22.  
  23. LEFT JOIN
  24.  
  25. (SELECT type_value,age_stage_v2,gender,
  26. address.VALUE AS city
  27. FROM user_profile.user_profile_oda
  28. lateral VIEW explode(resident_location_id) followTables AS address
  29. WHERE date_p = 20191109
  30. AND version_p = 'v1'
  31. AND type_p = 'gid'
  32. AND  address.id=1007
  33. AND address.VALUE = 14606) t3 ON t1.server_id = t3.type_value
  34.  
  35. LEFT JOIN
  36.  
  37. (SELECT uid,gid
  38. FROM
  39. stat_meitu.mtxx_oda_sdk_uid_gid
  40. WHERE date_p = 20191016
  41. GROUP BY uid,gid
  42. )t4 ON t1.server_id  = t4.gid
  43.  
  44. WHERE t2.gid IS NOT NULL AND t3.city IS NOT NULL
  45. AND device_info IS NOT NULL AND device_info <> 0
  46. AND LENGTH(device_info) > 1
  47. AND t3.age_stage_v2 IN ('1','2')
  48. GROUP BY t1.server_id,device_info,uid,gender
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement