Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
类似于无符号字段,但仅适用于负数。
我只是好奇。
这可以通过before-insert触发器来完成。
before-insert
CREATE DEFINER=`root`@`localhost` trigger triggerName BEFORE INSERT ON tableA FOR EACH ROW BEGIN IF(value > 0) THEN STOP ACTION END IF;
您可以在每次插入、更新和选择时使用无符号整数和减号。