oracle - Date Conversion from M20161 to Jan16 -


how convert m20161 jan-16 in oracle 2016 year , 1 month.

if "m" literal going present, enclose in double quotes in format mask. since there no day part it'll default first day of month.

select to_date('m20161', '"m"yyyymm') res   dual 

result:

res       --------- 01-jan-16 

to display date in desired jan-16 format, use to_char() function , mon-yy format model.

select to_char(to_date('m20161', '"m"yyyymm'), 'mon-yy') res   dual 

result:

res    ------ jan-16 

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -