Mysql
 sql >> Datenbank >  >> RDS >> Mysql

php:Wie man String-Daten in numerische Daten umwandelt

SELECT `Model`,
IF(`Class`='S', 1, 0) AS `S`,
IF(`Class`='A', 1, 0) AS `A`,
IF(`Class`='B', 1, 0) AS `B`,
IF(`Class`='C', 1, 0) AS `C`
FROM `inspection_report`