mysqldatabasedatabase-designprivileges

How can I ensure that there is one-and-only-one row in DB table?


I would like to ensure that my MySQL table myTable has one-and-only-one row.

I need to be able to Update this row but Insert and Remove should be not possible.

I am asking this question because of this answer to How to create a "unique" constraint on a boolean MySQL column?.


Solution

  • Two suggestions for you, one or both which may work depending on the particulars of the data you're trying to store:

    AND/OR