我有一张包含订单号、取消日期和原因的表格。原因字段是 varchar(255) 字段,它是由许多不同的销售代表编写的,很难按原因类别进行分组,我需要生成一份报告来对取消原因进行分类。用 TSQL 分析原因的最佳方法是什么?
销售代表输入的原因示例
cust already has this order going out
cust can not hold for item Called to cancel order
cust doesn't want to pay for shipping
wife ordered same item from different vendor, sent email
cst made a duplicate order, sent email
cst can't hold
Cust doesn't want to go through verification process so is cancelling order
doesn't ant to hold for Bo
doesn't want
Cust called to cancel the order He can no longer get the product he wants
cnt hld
will not comply with export req
cant' hold
Custs request
Cust will not hold for BO
per. cust. request.
顺便说一句,我有 SQL Server 2005。