Oracle use LIKE '%' on DATE

后端 未结 8 1961
灰色年华
灰色年华 2021-01-12 02:52

My table myTab has the column startDate, which has the datatype \"DATE\". The data in this column are stored like dd.mm.yyyy.

8条回答
  •  没有蜡笔的小新
    2021-01-12 03:10

    SELECT * FROM myTab WHERE startDate like '%-%-2015';
    

    This will search for all dates in 2015. If this doesn't work, try:

    SELECT * FROM myTab WHERE startDate like '%-%-15';
    

提交回复
热议问题