我用format(rq,"yy-MM") 想提取日期字段rq并转换为“年-月”的形式,但执行结果不正常,如图所示。
MySQL: select bm,date_format(rq,'%y-%m') from budget where bm='${dw}'
oracle: select bm,to_char(rq,'yy-mm') from budget where bm='${dw}'
sqlserver: select bm,right(year(rq),2)+'-'+month(rq) from budget where bm='${dw}'
select bm, left(rq,2)+'-'+right(left(rq,4),2) from budget where bm='${dw}'
什么数据库