SELECT WEEK(STR_TO_DATE( products_options_values, '%m-%d-%Y' ),1) as order_week,
YEAR(STR_TO_DATE( products_options_values, '%m-%d-%Y' ),1) as order_year
FROM orders_products_attributes
如果只是一周,我没有收到任何错误,但是一旦我尝试选择年份,它就会抛出
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1) as order_year FROM orders_products_attributes'...
我究竟做错了什么?