答案 0 :(得分:0)
CREATE TABLE Months (
mo INT );
INSERT INTO Months VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
SELECT DATE_FORMAT(DATE(CONCAT(LEFT(NOW(), 7), '-15')
- INTERVAL mo MONTH),
"%b-%y") AS MmmYY
FROM Months ORDER BY mo DESC;
那应该给你想要的标题。然后进行旋转,请参阅 http://mysql.rjweb.org/doc.php/pivot