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

Operazioni su date incomplete in MySQL

Puoi utilizzare IF e CONCAT per verificare la presenza di date incomplete e sostituire 00 con 01.

IF ( isnull(CONCAT(v6.title,v7.title,v8.title)), IF ( isnull(CONCAT(v7.title,v8.title)), v8.title, 
        CONCAT(v7.title,\'.\',v8.title) ),
        CONCAT(v6.title,\'.\',v7.title,\'.\',v8.title) ) AS "Datum",
        IF ( isnull(CONCAT(v9.title,v10.title)) & isnull(CONCAT(v11.title, v12.title)), v13.title, 
                   IF ( isnull(CONCAT(v9.title,v10.title)) & isnull(v13.title), CONCAT(v11.title,\'-\', v12.title),
                    IF ( isnull(CONCAT(v11.title,v12.title)) & isnull(v13.title), CONCAT(v9.title,\':\', v10.title, \' Uhr\'),
                    "Hello World" ) ) ) AS "Uhrzeit",