经过查看官网,发现5.7版本: 链接
With one exception, the default value specified in a DEFAULT clause must be a literal constantit cannot be a function or an expression . This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE . The exception is that, for TIMESTAMP and DATETIME columns, you can specify CURRENT_TIMESTAMP as the default. See Section 11.2.6, “Automatic Initialization and Updating for TIMESTAMP and DATETIME” .
创建表的时候,想为DATE类型设定默认值当前日期。发现一直报错,百度没有什么好办法。
只有思路:将传进去的按“-”分割,再将每一组数字按位截取,判断它的值,找到对应的大写,放在一个varchar里,依次累计添加,每组数字结束后,再将年、月、日加上,最后返回那个varchar
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)