MySQL CAST as DATE

Checking the source code of MySQL 5.6 CAST() and CONVERT() calls to the same internal function Item_date_typecast, DATE() calls to Item_date_typecast too.

In conclusion there is no difference between DATE(expr) function and the CAST(expr AS DATE).

Refs:

https://github.com/mysql/mysql-server/blob/5.6/sql/sql_yacc.yy

https://github.com/mysql/mysql-server/blob/5.6/sql/item_create.cc

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)