標籤:一 系統管理使用者1 查詢使用者集合select username from dba_users;A 查詢某個使用者是否存在select username from dba_users where username=‘使用者名稱‘2 查詢使用者權限select * from dba_sys_privs where grantee=‘使用者名稱‘3 建立使用者create user 使用者名稱 identified by 密碼;4 刪除使用者drop user wp cascade;5
標籤:多行一列資料合併/* Formatted on 2013-1-11 13:23:55 (QP5 v5.185.11230.41888) */ CREATE OR REPLACE FUNCTION GetGiftsName (rid in number)//rid 穿的參數 RETURN VARCHAR2 AS STR VARCHAR2 (1000);
標籤:增刪改查 交並補 內串連 外串連建立表: create table table_name( num int IDENTIFIED(1,1) not null, --identified自增量 name VARCHAR2(20) not null, --not null不為空白 age VARCHAR2(20), sex
標籤: ----建立預存程序create or replace procedure inserttest as cursor cs is select id, name, cla, addr, phone, tel, x, y, shape, objectid from hotel_bak t2;begin for c in cs loop BEGIN insert into hotel (id, name, cla,
標籤:擷取表欄位:select * from user_tab_columns where Table_Name=‘使用者表‘ order by column_name擷取表注釋:select * from user_tab_comments where Table_Name=‘使用者表‘order by Table_Name擷取欄位注釋:select * from user_col_comments where Table_
標籤:資料分組,分組函數max, min, avg, sum, count查詢工資最高的人的姓名select ename from emp where sal = (select max(sal) from emp);給所有低於平均工資的員工薪水上漲10%update emp set sal = (select avt(sal) from emp)*10% where sal<(select avt(sal) from emp);grout by 和 having 字句groupt