A stupid question:
I have to group in the same column different if statements. How can I do?
if(string='AAA','A','other'), if(string='BBB','B','other') AS COLUMN 1
Thanks!
use case statement
Select
Case
When string="AAA" then "A_String"
When string="BBB" then "B_String"
When String in ("CCC","DDD") then "C_OR_D_String"
Else "Unknow_String"
End AS String_Class
From My_Table
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With