SELECT r.id, r.transaction_date, 0 as batchid, r.telemrkt_company, t.company_code, count(*) as Cnt FROM result_detail r JOIN telemrkt_company t on r.telemrkt_company = t.id GROUP BY r.id, r.transaction_date, r.telemrkt_company, t.company_cod 1 2006-01-03 00:00:00.000 0 135 WEST 1 2 2006-01-03 00:00:00.000 0 135 WEST 1 3 2006-01-03 00:00:00.000 0 135 WEST 1 4 2006-01-03 00:00:00.000 0 135 WEST 1 5 2006-01-03 00:00:00.000 0 135 WEST 1Problem is, I need back one record with a count of 5. Because the Id is required, the
>>>>SELECT r.id, >>>> r.transaction_date, >>>> 0 as batchid, >>>> r.telemrkt_company, >>>> t.company_code, >>>> count(*) as Cnt >>>>FROM result_detail r >>>>JOIN telemrkt_company t on r.telemrkt_company = t.id >>>>