SET @variable1 = (SELECT DAY(LAST_DAY('2016-03-01')) as lastday);
SELECT @variable1 as last_day,
DAYNAME(CONCAT('2016-03-',@variable1)) as day_name;
我可以获得3天31天的天数,但我怎么能从1到31获得日期名称?
其中select语句会以某种方式显示:
dayname | day count
tuesday 01
wednesday 02
.... ...
thursday 31
答案 0 :(得分:0)
您可以创建临时表,然后执行循环以插入所需数据
{{1}}
然后从“临时表”中选择*