SHARE
TWEET

DontWantFuse

PRP_UA Feb 13th, 2020 (edited) 250 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. WITH PoolOfUsers
  3. AS (
  4.     SELECT DISTINCT UserID AS U_ID
  5.     FROM dbo.EquipmentMovement
  6.     WHERE  ClientVersion IN ('0.0.105', '0.0.108')
  7.     AND UserID NOT IN (SELECT DISTINCT UserID  FROM dbo.EquipmentMovement WHERE TriggerSourceId = 'Fuse' )
  8. )
  9.  
  10. , WantNotFuse
  11. AS (
  12.     SELECT UserID, HeroSlotCategoryId, EquipmentId
  13.     , Count(*) AS Amount
  14.     FROM dbo.EquipmentMovement AS EM INNER JOIN PoolOfUsers AS pou ON pou.U_ID = em.UserId
  15.    -- WHERE TriggerSourceId = 'Fuse'
  16.     GROUP BY UserID, HeroSlotCategoryId, EquipmentId
  17.     HAVING Count(*) >= 3
  18. )
  19.  
  20. SELECT Count (Distinct UserId) FROM WantNotFuse
  21.  
  22. --SELEcT TOP (100) * FROM WantNotFuse
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top