【发布时间】:2019-12-09 01:59:05
【问题描述】:
我需要捕获两个不同的时间戳,一个用于incoming_patients,另一个用于outcoming_patients。我需要限制 outcoming_patient 时间戳必须晚于传入的时间戳。
create table hold (
incoming_date timestamp,
outcoming_date timestamp CHECK (EXTRACT(HOUR FROM incoming_date) > (EXTRACT(HOUR FROM outcoming_date)),
提前致谢。
【问题讨论】:
-
是sql server吗?
-
为什么只检查小时而不检查分钟、秒、日、年和月?如果incoming_date 应该晚于outcoming_date 你应该简单地使用
check (outcoming_date > incoming_date)? -
嗨。感谢您的回复。我在mysql上,我会发布解决方案。