有没有办法根据结果本身将SQL查询的结果表示为不同的值?例如,每次数据库中的实际值为'foo'时,我希望表中的结果显示为'bar'.
用一个 case
select case when col1 = 'foo'
then 'bar'
else col1
end as col1
from your_table
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
53 次 |
| 最近记录: |