如下图所示,现在月份是 1 和 2。如何将其转换为 1 到 Jan,2 到 Feb 等等。下面是我的sql。
帮助将不胜感激。提前致谢!:)
SELECT DISTINCT fbmenuname,
Sum(quantity) AS ordercount,
Month(Str_to_date(date, '%d/%m/%Y')) AS month
FROM fb.fborders
INNER JOIN fb.fbmenu
ON fborders.fbmenuid = fbmenu.fbmenuid
INNER JOIN fb.fbrestaurant
ON fbrestaurant.fbrestaurantid = fbmenu.fbrestaurantid
WHERE fborders.status = 'completed'
AND ( Year(Str_to_date(date, '%d/%m/%Y')) = '2013'
AND fbrestaurant.fbrestaurantid = 'R0001' )
GROUP BY fbmenuname,
Month(Str_to_date(date, '%d/%m/%Y'))