title: Efficient query for finding duplicate records
body: <p>I need to query a table for duplicate deposit records, where two deposits made at one cash terminal, for the same amount, within a certain time window, are considered duplicate records.  I've started  working on a query now, but I would appreciate any advice or suggestions on doing this 'properly'.</p>