2024-11-25 17:42:05
有的value1的内容如下:gh40。按上述方法该怎么处理呢
SELECT CASE WHEN VALUE1 LIKE '%40%' THEN '40'
WHEN VALUE1 LIKE '%20%' THEN '20'
WHEN VALUE1 LIKE '%50%' THEN '50'
else null end, SUM(weight)
FROM tab
group by CASE WHEN VALUE1 LIKE '%40%' THEN '40'
WHEN VALUE1 LIKE '%20%' THEN '20'
WHEN VALUE1 LIKE '%50%' THEN '50'
else null end
2024-11-25 18:19:21
2024-11-25 11:16:42