I have a table like this
create table tbl_1(
year int,
month int,
day int
)
insert into tbl_1 values(2009, 11, 30)
insert into tbl_1 values(2010, 3, 4)
insert into tbl_1 values(2011, 5, 13)
insert into tbl_1 values(20011, 12, 24)
I want to remove the date from 2009-11-30 to 2011-5-13, but I cannot, because all the columns are int, and I cannot use this query:
delete from tbl_1
where year >=2009
and year<=2011
and month >=11
and month <=5
and day >=30
and day <=13
.. because: 1 <month <12 and 1 <day <30
I know this is a terrible mistake.
I have many tables that use this method to save the date, please help me. I don’t have time to delete and recreate all of them.
source
share