0
How can I generate a Date in SQL with GENERATED ALWAYS AS (XXX)?
I want to have a Date as primary key, which is automatically generated every time that the user enters a new entry. Is that possible?
2 ответов
+ 1
I don't recommend that, since the primary key has to be unique. What if there are more than one entries made on a single day?
0
It is not possible that there is more than one entry per day in this table. That's why the table's primary key should be this date: Every day certain values are saved in this table, but just in one row per day.