SQL>
-- 查看表结构
SQL> DESC k
Name Type Nullable Default Comments
---------- ------------------------- -------- ------- --------
UID INTEGER Y
INTERVALYM INTERVAL YEAR(2) TO MONTH Y
ID INTEGER Y
-- 使用check关键字
SQL> ALTER TABLE k ADD CONSTRAINT uk_k_id CHECK(ID IS NOT NULL);
Table altered
-- 删除约束
SQL> ALTER TABLE k DROP CONSTRAINT uk_k_id;
Table altered
-- 通过MODIFY字段名
SQL> ALTER TABLE K MODIFY ID CONSTRAINT UK_K_ID NOT NULL;
Table altered
阅读(1005) | 评论(0) | 转发(0) |