MySQL 带有 LIKE 字符串的案例语句

MySQL Case Statement with LIKE for string

我有一个 table 和一个现有的 user_agent 列,我想根据用户代理是否包含子字符串 'windows''os x' 创建一个新列MySQL,我无法弄清楚哪里出了问题,也无法在本网站上找到带有 LIKE 字符串的 case 语句示例。我的 MySQL 版本是 8.0.26.

SELECT user_id, 
    CASE user_agent 
    WHEN LIKE '%windows%' THEN 'Windows'
    WHEN LIKE '%OS X%' THEN 'Mac'
    Else 'Other'
    END AS Operating System

    FROM pageviews;
SELECT user_id, 
    CASE 
    WHEN user_agent  LIKE '%windows%' THEN 'Windows'
    WHEN user_agent  LIKE '%OS X%' THEN 'Mac'
    Else 'Other'
    END AS  `Operating System` 

    FROM pageviews;