使用较小的桶创建新的 SQL 列(基于文本,而不是数字)

Create New SQL Column With Smaller Buckets (Based on Text, not Numbers)

我在 SQL 中有一个包含多个 "Definitions" 的列,但我希望任何以 DEF 开头的内容都只是通用的 "Definition".

我可以在我的 Select 语句中输入什么来转换它?

您可以使用 case:

select (case when current_output like 'DEF%' then 'DEFINITION'
             else current_output
        end) as desired_output