由于“8 月星期二的中午”(“La Grande Jatte 岛上的星期日下午”?)没有指定年份,唯一真正的解决方案是您的所有日期和时间组件表,都可以为空。
否则,您会混淆您的数据。
这里有两个(公认相关的)东西:一个人类可读的字符串、date_description 和一个可能的日期范围。
如果您至少可以指定一个范围,则可以这样做:
create table artwork {
artwork_id int not null primary key,
name varchar(80),
... other columns
date_description varchar(80),
earliest_possible_creation_date datetime
latest_possible_creation_date datetime
}
insert into artwork(
name,
date_description,
earliest_possible_creation_date,
latest_possible_creation_date
) values (
'A Sunday Afternoon on the Island of La Grande Jatte',
'Mid-afternoon on a Tuesday in August'
'1884-01-01',
'1886-12-31'
), (
'Blonde Woman with Bare Breasts',
'Summer 1878'
'1878-05-01',
'1878-08-31'
), (
'Paulo on a Donkey',
'Early June 1923',
'1923-06-01'
'1923-06-15'
);
这允许您显示任何您想要的内容并搜索:
select * from artwork
where @some_date between
earliest_possible_creation_date and latest_possible_creation_date;
显然,“创作日期”(艺术家创作作品的日期)与“作品中描绘的日期”完全不同,如果后者可以确定的话。