I'm not quite sure how this phrase is, but it goes here ... We have a table structure such as:
Id | Timestamp | Type | Clientid | ..others..
001 | 1234567890 | TYPE1 | CL1234567 |.....
002 | 1234561890 | TYPE1 | CL1234567 |.....
Now for the data above ... I would like to have a restriction so that these 2 rows cannot exist together. Essentially, I want the table to be
Unique for (Type, ClientId, CEIL(Timestamp/10000)*10000)
I do not want rows with the same data created during X times of each other to be added to db, that is, in this case the restriction would be violated. The problem is that the specified restriction is not something that I can create.
Before asking, I know, I know ... why right? Well, I know that a certain scenario should not happen, but, alas, it is. At the moment, I need some measure of stopping, so I can buy some time to investigate the real issue. Let me know if you need more information ...
source
share