Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的查询SELECT EXTRACT(YEAR_MONTH FROM <date>) FROM <table>;
SELECT EXTRACT(YEAR_MONTH FROM <date>) FROM <table>;
此查询的输出是201309
但是如何像Sep-2013那样得到它,而且它也是一个日期?
SELECT date_format(curdate(), '%b-%Y')
日期格式()
SELECT CONCAT(MONTHNME(<date>), "-", YEAR(<date>) FROM <table>;