Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. select source_id,sum(sum1)
  2. from
  3. (
  4. select distinct b.source_id,
  5. case when b.type_id=12031 then 15
  6. when b.type_id=12010 the n 5
  7. when b.type_id=12006 then 5
  8. when b.type_id=11051 then 3
  9. when b.type_id=11047 then 2
  10. when b.type_id=11046 then 2
  11. when b.type_id=11045 then 0
  12. when b.type_id=11044 then 1
  13. when b.type_id=11043 then 0
  14. when b.type_id=11042 then 5
  15. when b.type_id=11041 then 0
  16. when b.type_id=11039 then 15
  17. when b.type_id=11038 then 10
  18. when b.type_id=11036 then 4
  19. when b.type_id=11031 then 3
  20. when b.type_id=11029 then 3
  21. when b.type_id=11028 then 0
  22. when b.type_id=11027 then 0
  23. when b.type_id=11025 then 0
  24. when b.type_id=11023 then 0
  25. when b.type_id=11019 then 0
  26. when b.type_id=11017 then 0
  27. when b.type_id=11016 then 0
  28. when b.type_id=11015 then 0
  29. when b.type_id=11012 then 0
  30. when b.type_id=11011 then 0
  31. when b.type_id=11008 then 0
  32. when b.type_id=11007 then 4
  33. when b.type_id=11005 then 8
  34. when b.type_id=11002 then 3
  35. when b.type_id=3810 then 15
  36. when b.type_id=3808 then 15
  37. when b.type_id=3807 then 15
  38. when b.type_id=3806 then 7
  39. when b.type_id=3805 then 8
  40. when b.type_id=3802 then 3
  41. when b.type_id=2075 then 0
  42. when b.type_id=2061 then 5
  43. when b.type_id=2054 then 5
  44. when b.type_id=2038 then 7
  45. when b.type_id=2035 then 3
  46. when b.type_id=2034 then 3
  47. when b.type_id=2032 then 3
  48. when b.type_id=2031 then 4
  49. when b.type_id=2030 then 3
  50. when b.type_id=2029 then 3
  51. when b.type_id=2023 then 0
  52. when b.type_id=2017 then 1
  53. when b.type_id=2015 then 1
  54. when b.type_id=2007 then 3
  55. when b.type_id=2000 then 6
  56. when b.type_id=1146 then 5
  57. when b.type_id=1117 then 0
  58. when b.type_id=1099 then 0
  59. when b.type_id=1098 then 0
  60. when b.type_id=1096 then 0
  61. when b.type_id=1094 then 0
  62. when b.type_id=1090 then 0
  63. when b.type_id=1089 then 0
  64. when b.type_id=1087 then 0
  65. when b.type_id=1086 then 0
  66. when b.type_id=1083 then 0
  67. when b.type_id=1080 then 0
  68. when b.type_id=1078 then 0
  69. when b.type_id=1077 then 0
  70. when b.type_id=1056 then 15
  71. when b.type_id=1045 then 0
  72. when b.type_id=1043 then 0
  73. when b.type_id=1041 then 10
  74. when b.type_id=1027 then 0
  75. when b.type_id=1005 then 0
  76. else
  77. 0 end as sum1
  78. from apd.Behaviors b
  79. ) v
  80. group by source_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement