Created
September 14, 2018 02:53
-
-
Save huangzhuolin/3e52ea807986b0b1508ea6930819ba5e to your computer and use it in GitHub Desktop.
[mysql select case when] #mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select case field_a | |
when '1' then 'cat' | |
when '2' then 'dog' | |
else 'unknown' | |
end | |
from my_table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment