email id transaction year Net amount($) Count of transaction --------- ---------------- ------------ ------------------- ab@xy.com 2008 32 ab@xy.com 2008 20 ab@xy.com 2008 565 ab@xy.com 2009 55 ab@xy.com 2010 88 ab@xy.com 2010 45 ab@xy.com 2009 5 cd@cv.com 2005 8 cd@cv.com 2005 5 cd@cv.com 2011 65 cd@cv.com 2011 665 cd@cv.com 2011 56 cd@cv.com 2011 8
ab@xy.com 2008 617 3 ab@xy.com 2009 55 1 ab@xy.com 2010 133 2 etc...
SELECT emailid, transyear, sum(transvalue), count(transvalue) FROM myTable GROUP BY emailID, transyear
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)