草庐IT

constantvaluetable

全部标签

mysql - MySQL 表中的常量列值

我在MySQL中有一张表。我想将表的列值设置为常量整数。我该怎么做? 最佳答案 UnfortunatelyMySQLdoesnotsupportSQLcheckconstraints.YoucandefinetheminyourDDLqueryforcompatibilityreasonsbuttheyarejustignored.YoucancreateBEFOREINSERTandBEFOREUPDATEtriggerswhicheithercauseanerrororsetthefieldtoitsdefaultvaluewh