Skip to content
Advertisement

create a composite unique key constraint with only the year part of date

I have a composite unique constraint that I need to implement to my table, it contains these columns: N, year (part of DATE_), ID_OPERATION.

The code I tried to write was not correct

is it possible and how?

Advertisement

Answer

Constraint won’t work (as far as I can tell), but unique index will.

This won’t work:

But this will:

Testing:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement