SHARE
TWEET

Untitled

a guest Aug 13th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT *
  2. FROM table AS A
  3. WHERE rowid IN (SELECT rowid FROM table WHERE value=A.value LIMIT 5)
  4.      
  5. Input:
  6.  
  7. SOURCE  DATE            VALUE
  8.  
  9. IG  2018-12-31  ONE
  10. IG  2019-05-24  TWO
  11. IG  2018-12-31  THREE
  12. TW  2019-06-24  SIX
  13. FB  2019-06-24  FIVE
  14. FB  2019-06-24  FIVE
  15. FB  2019-06-24  ONE
  16. FB  2019-06-24  THREE
  17. FB  2019-06-18  FIVE
  18. FB  2019-06-18  SIX
  19. FB  2019-06-18  ONE
  20. FB  2019-06-18  ONE
  21. IG  2019-06-24  TWO
  22. FB  2019-05-24  THREE
  23. IG  2019-06-24  THREE
  24. RD  2019-06-24  TWO
  25. RD  2019-06-24  SIX
  26. RD  2019-06-24  ONE
  27. TW  2019-06-24  FIVE
  28. FB  2019-06-24  TWO
  29.  
  30. =============
  31.  
  32. Output:
  33.  
  34. SOURCE  DATE            VALUE
  35.  
  36. FB  2019-06-24  ONE
  37. FB  2019-06-18  ONE
  38. IG  2019-05-24  TWO
  39. RD  2019-06-24  TWO
  40. FB  2019-05-24  THREE
  41. IG  2019-06-24  THREE
  42. FB  2019-06-24  FIVE
  43. FB  2019-06-24  FIVE
  44. FB  2019-06-18  SIX
  45. RD  2019-06-24  SIX
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