常用SQL整理
1、添加一個或多個字段:
alter table tableName add column1 int(12) DEFAULT NULL;alter table tableName add (column1 int(12) DEFAULT NULL, column2 float(12,2) DEFAULT 0, column3 varchar2(10) DEFAULT null, ...);?
2、刪除一個或多個字段:
alter table tableName drop column1;alter table tableName drop (column1, column2, column3, ...);?
3、更新字段:
update tableName set column1=1, column2=1, ... where condition;?
4、添加表、字段注釋:
comment on table tableName is '***';comment on column tableName.columnName is '***';?
5、鎖表查詢:
select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao, v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid;?
6、查看oracle字符集
select userenv('language') from dual;?
7、數據庫操作
?
?
?
轉載于:https://www.cnblogs.com/yl-fighting/p/3196231.html
總結
- 上一篇: JQuery的$(document).r
- 下一篇: C++中实现 time_t, tm 相互