CREATE TABLE t1 (
my_month VIRTUAL INT AS (DATE_FORMAT(d,'%Y%m'))
And later, when you insert '2008-08-23' in my_date, then
automatically my_month will be set to 200808.
Yes, it would be cool, and it has been done. Andrey Zhakov, a so far unknown to me community contributor, has extended the server code to implement virtual columns ( …