Here is my data
cardNo| userName| tablename| hours | date 1 | a | a | 12 | 12-06-2015 1 | a | a | 5 | 11-06-2015 2
SELECT cardNo,userName, tablename, sum(hours) hours FROM Table_1 GROUP BY cardNo,userName,tablename