1
ข้อ จำกัด ที่ไม่ซ้ำกับช่วงวันที่
พิจารณาpricesตารางที่มีคอลัมน์เหล่านี้: id integer primary key product_id integer -- foreign key start_date date not null end_date date not null quantity integer price numeric ฉันต้องการให้ฐานข้อมูลบังคับใช้กฎว่าผลิตภัณฑ์หนึ่ง ๆ สามารถมีราคาหนึ่งรายการในปริมาณเฉพาะในช่วงวันที่ (ผ่านwhere <date> BETWEEN start_date AND end_date) ข้อ จำกัด ประเภทนี้เป็นไปได้หรือไม่