Limit amount of SQL information [closed]

0

How can I limit the number of rows in my SQL table? (without being limited in select, it's not like querying) eg, I have to have at most 10 information in the table, but it is not limiting, if 30 people register, the table will have 30 information instead of 10.

    
asked by anonymous 21.10.2018 / 22:01

1 answer

1

Natively this is not possible friend, I'll give you 2 possible solutions.

The first you can create a trigger that checks the number of records and then inserts into the database.

Second is to do the treatment in your own application by performing the search in the database before performing the insertion.

Particularly in your situation preferred the first option.

    
21.10.2018 / 22:12