Guest User

Untitled

a guest
Aug 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. select [trsDate],[store],CHECKSUM_AGG(checksum(amt,qty,total))
  2. from BigTable
  3. where store='111'
  4. AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
  5. group by [trsDate],[store]
  6. order by [trsDate],[store]
  7.  
  8. SELECT trsDate, store,'BigTable',
  9. amt=SUM(ISNULL(amt,0)),
  10. qty=SUM(ISNULL(qty,0)),
  11. total=SUM(ISNULL(total,0))
  12. FROM BigTable
  13. WHERE trsDate BETWEEN '2016-01-01' and '2016-01-30'
  14. AND store='111'
  15. GROUP BY trsDate,store
  16.  
  17. select [trsDate],[store],CHECKSUM_AGG(checksum([trsDate],[store],terminal,trsNumb,linenumb))
  18. from BigTable
  19. where store='111'
  20. AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
  21. group by [trsDate],[store]
  22. order by [trsDate],[store]
  23.  
  24. SELECT [trsDate],[store], HASHBYTES('SHA2_512', concat(COUNT(*),CHAR(26), SUM(amt+qty+total))
  25. from BigTable
  26. where store='111'
  27. AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
  28. group by [trsDate],[store]
  29. order by [trsDate],[store]
Add Comment
Please, Sign In to add comment