code_junkie

Duplicate result

Nov 11th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. SELECT DISTINCT MyColumn FROM MyTable;
  2.  
  3. SELECT MyFirstColumn, MySecondColumn, MAX(SomeDate) AS MaxDate, SUM(Amount) AS TotalAmount
  4. FROM MyTable
  5. GROUP BY MyFirstColumn, MySecondColumn;
Add Comment
Please, Sign In to add comment