怎样将字符串形式的'2019-07-01'变成‘7/1’这种类型,用sql语句
str(mid(字段,6,2)*1)+'/'+str(right(字段,2)*1) 忘了sql server 没有mid函数。
用 select replace(str(substring('2019-07-01',6,2)*1)+'/'+str(right('2019-07-01',2)*1),' ','')
oracle:SELECT to_char(to_date('2019-07-01','yyyy-mm-dd'),'mm/dd') FROM DUAL;
oracle - 去除0 : select to_number(to_char(to_date('2019-07-01','yyyy-mm-dd'),'mm'))||'/'||to_number(to_char(to_date('2019-07-01','yyyy-mm-dd'),'dd')) from dual;