oracle的常用命令

1.给表增加PK的SQL语句
ALTER TABLE 表名 ADD CONSTRAINT 约束名 PRIMARY KEY (字段名);

CREATE TABLE TEM_ORDER AS SELECT * FROM OS_ORDER_ITEM
TRUNCATE TABLE OS_ORDER_ITEM;
ALTER TABLE OS_ORDER_ITEM ADD CONSTRAINT OS_ORDER_ITEM_PK PRIMARY KEY(OS_ORDER_ITEM_ID);
INSERT INTO OS_ORDER_ITEM SELECT * FROM TEM_ORDER T; 

2.获得当前系统时间
select sysdate from dual

你可能感兴趣的:(oracle,sql,OS)