i have a table with values like this,
i want to group by cusotmer name where as sum of the local amount should exceed 50000 else i need to delete those records which do not satisfy?
how to achieve it in sql server 2005?
TRN 259 3 9/9/2010 6622 68667(Rs) ABHIJIT KATARE
TRN 260 3 9/9/2010 6622 14635(Rs) ABHIJIT KATARE
TRN 235 3 9/9/2010 6586 68128 AJAY PARASRAMPURIA
TRN 236 3 9/9/2010 6586 14490 AJAY PARASRAMPURIA
TRN 257 3 9/9/2010 6621 68667 ANAND DESAI
TRN 258 3 9/9/2010 6621 14635 ANAND DESAI
TRN 287 3 9/9/2010 6817 119095 ANAND KATAKAM
TRN 242 3 9/9/2010 6594 95689 ANILKUMAR MUTHUNPARA
TRN 211 3 9/9/2010 6507 52239 ARBIND KUMAR GUPTA
TRN 212 3 9/9/2010 6538 63183 ASHOK KELKAR
TRN 185 3 9/9/2010 6431 140610 BANSAL Y.K
TRN 186 3 9/9/2010 6431 46845 BANSAL Y.K
TRN 248 3 9/9/2010 6600 72565 BENNO HANS LUKE