上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: user_tables -- 查询当前用户有哪些表 user_table_columns –表字段信息 alter table table_name add column_name varchar2(10);--增加字段 alter table table_name modify column_na 阅读全文
posted @ 2020-02-17 21:37 admin_jh 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1、用户 create user user_name identified by pwd ;--创建用户 alter user user_name identified by newpwd;--修改用户密码 上面创建好的用户还不能登录数据库,必须给一个create session系统权限 2、特权 阅读全文
posted @ 2020-02-17 17:03 admin_jh 阅读(1119) 评论(0) 推荐(0) 编辑
摘要: 管理员用户(sys、system)下的dbms_flashback包 1.给用户(以scott为例)授权操作dbms_flashback包:sqlplus用sys登录,执行命令:grant execute on sys.dbms_flashback to scott; 方式一:按照时间闪回: 用Sc 阅读全文
posted @ 2020-02-17 15:44 admin_jh 阅读(204) 评论(0) 推荐(0) 编辑
摘要: --合并两张表的内容 merge into new_table using old_table on (new_table.id = old_table.id) when matched then update newtable .... when not matched then insert n 阅读全文
posted @ 2020-02-16 21:23 admin_jh 阅读(1161) 评论(0) 推荐(0) 编辑
摘要: 统计不同产品类别在不同月份的销量:pivot 和 unpivot CREATE OR REPLACE VIEW AQKCCKL_NEW_FIN_V AS SELECT T.*, NVL(T.M1,0)+NVL(T.M2,0)+NVL(T.M3,0)+NVL(T.M4,0)+NVL(T.M5,0)+N 阅读全文
posted @ 2020-02-16 20:48 admin_jh 阅读(378) 评论(0) 推荐(0) 编辑
摘要: --层次化查询,利用伪列level和lpad函数来判断 select level,lpad(' ',2 * level - 1) || last_name from more_employees --这里可以加where条件查询 start with employee_id = (select em 阅读全文
posted @ 2020-02-16 18:40 admin_jh 阅读(240) 评论(0) 推荐(0) 编辑
摘要: --translate(p1,p2,p3):p2中查找p1中的内容匹配到之后转换到p3的位置内容 select translate('I am a student', 'abcdefghijklmnopqrstuvwxyz', 'zyxwvutsrqponmlkjihgfedcba') from d 阅读全文
posted @ 2020-02-16 18:17 admin_jh 阅读(357) 评论(0) 推荐(0) 编辑
摘要: create table 销售表 (产品id int,客户id int,销售日期 timestamp(4)); --timestamp(秒精度) insert into 销售表 values(100,1058,timestamp '2020-02-14 17:58:45.1234'); --time 阅读全文
posted @ 2020-02-14 18:23 admin_jh 阅读(1657) 评论(0) 推荐(0) 编辑
摘要: alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'; 阅读全文
posted @ 2020-02-14 17:45 admin_jh 阅读(684) 评论(0) 推荐(0) 编辑
摘要: --进入用sys进入sqlplus修改 --win + r --> cmd --在cmd命令窗口输入:sqlplus / as sysdba --修改用户密码:alter user Scott identified by p@ssw0rd; 注:可以修改sys密码 阅读全文
posted @ 2020-02-13 18:02 admin_jh 阅读(466) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页