i have a table with some data i want to merge the identical row i.e.as shown in image two identical rows having same tDateWorked,empid,jobid i want to merge this records so that OT and ST should appears in same line.
Advertisement
Answer
You can use aggregation:
select tDateWorked, empId, craftCodeId, jobId, sum(ot) as ot, sum(st) as st from t group by tDateWorked, empId, craftCodeId, jobId;