CASE
WHEN DATEDIFF(CURRENT_DATE,books_transaction.date_out)>10
    THEN UPDATE books_transaction SET books_transaction.fine = 50
    ELSE UPDATE books_transaction SET books_transaction.fine = 100
END CASE;
END

ERROR #1054 неизвестная колонка 'date_out' в 'списке полей'

Ответы (1)

UPDATE books_transaction
SET fine = CASE WHEN DATEDIFF(CURRENT_DATE,date_out)>10
                ТО 50
                ИЛИ 100
                END;

2022 WebDevInsider