Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select [trsDate],[store],CHECKSUM_AGG(checksum(amt,qty,total))
- from BigTable
- where store='111'
- AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
- group by [trsDate],[store]
- order by [trsDate],[store]
- SELECT trsDate, store,'BigTable',
- amt=SUM(ISNULL(amt,0)),
- qty=SUM(ISNULL(qty,0)),
- total=SUM(ISNULL(total,0))
- FROM BigTable
- WHERE trsDate BETWEEN '2016-01-01' and '2016-01-30'
- AND store='111'
- GROUP BY trsDate,store
- select [trsDate],[store],CHECKSUM_AGG(checksum([trsDate],[store],terminal,trsNumb,linenumb))
- from BigTable
- where store='111'
- AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
- group by [trsDate],[store]
- order by [trsDate],[store]
- SELECT [trsDate],[store], HASHBYTES('SHA2_512', concat(COUNT(*),CHAR(26), SUM(amt+qty+total))
- from BigTable
- where store='111'
- AND trsDate BETWEEN '2016-01-01' and '2016-01-30'
- group by [trsDate],[store]
- order by [trsDate],[store]
Add Comment
Please, Sign In to add comment