Answer the question
In order to leave comments, you need to log in
How to limit the number of records in a table with a specific field?
Hello. Is it possible to somehow limit the number of records with a certain field in the database without triggers and procedures?
For example, there is a table in which there is a user_id field, is it possible to make a user with a user_id, for example 5, be able to make only 10 entries.
Answer the question
In order to leave comments, you need to log in
start transaction
select count(*) from ... where user_id = ... for update
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question