I know you can set a single field in a table to be unique(not allowing duplications), but is there a way to do it to a combination of fields? For example, if I have a day field and an hour field, and I want to set it that there can only be one row in the table for each combination of day and hour:
Day 1 Hour 1
Day 1 Hour 2 - allowed - it's the same day but with a different hour
Day 2 Hour 1 - allowed - it's the same hour but with a different day
Day 1 Hour 1 - not allowed - same day and same hour.
Now, I know it can be done by setting those fields to be a multifield PK, but I don't want to make them PK, cause it'll eventually add up to tables with 4+ fields PK, and that's a disaster...
So, any suggestions?
Day 1 Hour 1
Day 1 Hour 2 - allowed - it's the same day but with a different hour
Day 2 Hour 1 - allowed - it's the same hour but with a different day
Day 1 Hour 1 - not allowed - same day and same hour.
Now, I know it can be done by setting those fields to be a multifield PK, but I don't want to make them PK, cause it'll eventually add up to tables with 4+ fields PK, and that's a disaster...
So, any suggestions?