SQLite Forum

Unique every N seconds. How?
Login
You cannot use expressions in the unique constraint inside a table definition,  You may, however, use that expression in a CREATE UNIQUE INDEX staeement (the unique constraint in a table definition is merely syntactic sugar for a create unique index statement but it is restricted to pure column names and not expressions).

That said, this will not be "unique every N seconds".

You *might* achieve that by creating the following unique index:

```
qlite> create table t (col1, col2, dt);
sqlite> create unique index ut on t (col1,col2,strftime('%s',dt)/10);
```