sql >> Base de Datos >  >> RDS >> Mysql

Operaciones en fechas incompletas en MYSQL

Puede usar IF y CONCAT para buscar fechas incompletas y reemplazar 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",