SELECT acc_code,sum(open_dr) as dr_amount,sum(open_cr) as cr_amount from master where LEN(acc_code)>4 and left(acc_code,4)='2305' group by acc_codethe codes generates results group by acc_code like shown in attachment.
SELECT acc_code,sum(open_dr) as dr_amount,sum(open_cr) as cr_amount from master where LEN(acc_code)>4 and left(acc_code,4)='2305' group by LEFT(acc_code,2)='23'Please help