Mysql
 sql >> Database >  >> RDS >> Mysql

Come usare la condizione if/else in una select in mysql

Usa CASE

SELECT CASE Type
        WHEN "Initial Read" THEN Initial_Column
        WHEN "Final Read" THEN Final_Column
       END column
FROM table_name
WHERE <some condition>