---sqlserver写法: SELECT COUNT(1),remark FROM ( SELECT Remark=CASE WHEN Remark LIKE '%CHECK TKT TIME%' THEN '保留时间有问题' WHEN Remark LIKE '%WITH "AV" AGAIN%' THEN '没有舱位' WHEN Remark LIKE 'DUPLICATE TEL NUMBER%' THEN '订位授权OFFICE号重复' WHEN Remark LIKE '%INVALID FOID%' THEN '证件号错误' ELSE '其他' end FROM JinRiLogger.dbo.UserOperateLog201307 WITH(NOLOCK) WHERE OperateType=8 ) AS a GROUP BY a.Remark ---oracle写法: SELECT CASE WHEN Remark LIKE '%CHECK TKT TIME%' THEN '保留时间有问题' WHEN Remark LIKE '%WITH "AV" AGAIN%' THEN '没有舱位' WHEN Remark LIKE 'DUPLICATE TEL NUMBER%' THEN '订位授权OFFICE号重复' WHEN Remark LIKE '%INVALID FOID%' THEN '证件号错误' ELSE '其他' end,count(*) FROM JinRiLog.UserOperateLog partition (p2) where Operatetype=8 group by CASE WHEN Remark LIKE '%CHECK TKT TIME%' THEN '保留时间有问题' WHEN Remark LIKE '%WITH "AV" AGAIN%' THEN '没有舱位' WHEN Remark LIKE 'DUPLICATE TEL NUMBER%' THEN '订位授权OFFICE号重复' WHEN Remark LIKE '%INVALID FOID%' THEN '证件号错误' ELSE '其他' end ;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。