關於更新Oracle date類型列值

來源:互聯網
上載者:User

今天更新emp表的hiredate列值 類型是date

使用第一條語句 update myemp set hiredate='1985-03-06' where ename='liutao';

不成功

想不成然後再使用 update myemp set hiredate='03-06-85' where ename='liutao'

不成功

然請來了網上共同學習的網友.基本上沒有什麼協助.為瞭解決這個問題,我再請了一位我的同事.和我一樣經過幾次交鋒.不成功

無奈度娘用上了..其實真不想用她,這麼簡單的文法都不定,對不起這段時間學習

經過一翻查閱發現 to_date函數可行.有點說的通.於是

update myemp set hiredate=to_date('1985-03-06','yyyy-mm-dd') where ename='liutao';

1 row update

真眼熟

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.