I’d like to limit the entries in a table. Let’s say in table tBoss. Is there a SQL constraint that checks how many tuples are currently in the table? Like
SELECT COUNT(*) from tBoss < 2
Firebird says:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown – line 3, column 8.
SELECT.
Does your database have triggers? If so, Add a trigger that rolls back any insert that would add more than 2 rows…
but to answer your question directly, the predicate you want is to just put the select subquery inside parentheses. like this …