--列出各個部門中工資高於本部門的平均工資的員工數和部門號,並按部門號排序select * from emp e1,(select round(avg(sal),2) sal,deptno from emp group by deptno) e2 where e1.sal>e2.sal and e1.deptno=e2.deptno order by e1.deptno asc; 建立test表 --行轉列的測試create table test(id number
安裝oracle 9i後,居然把剛剛更改的資料庫管理員密碼給忘了,又不重新安裝,太麻煩了,試了好久,終於修改成功了。 1、運行到C盤根目錄 2、輸入:SET ORACLE_SID = 你的SID名稱 3、輸入:sqlplus/nolog 4、輸入:connect/as sysdba 5、輸入:altre user sys identified by sys 6、輸入:altre user system identified by system
t_medflow 表擁有1千萬資料 FlowId是主鍵 擁有主鍵索引 統計總數量 select count(FLOWID) from t_medflow t 用時:1.5秒 select count(*) from t_medflow t 用時:1.46秒 多次測試效率差不多 添加條件查詢 select count(FLOWID) from t_medflow t where pname like '%中%' 用時:25
What is a foreign key? A foreign key means that values in one table must also appear in another table. The referenced table is called the parent table while the table with the foreign key is called the child table. The foreign key in the child
/*登入*/ C:>sqlplus /nolog; ...SQL> conn /as sysdba;(本機資料庫)SQL> conn user/passwd;(切換使用者用) /*建立一個和已經存在的表列名和類型相同的空表*/ create table table_bak as select * from table where 1<>1; /*解決ora-28001 the password has
Note: this piece was co-written with Aiaz Kazi, head of Technology Marketing at SAP On Sunday night, during Larry Ellison’s lackluster Open World keynote, Oracle finally announced their in-memory analytic appliance dubbed Exalytics, validating
union/union all運算:將查詢的返回組合成一個結果, union all不過濾重複。 SELECT product_id FROM order_itemsUNIONSELECT product_id FROM inventories;SELECT location_id FROM locations UNION ALL SELECT location_id FROM departments; intersect運算:返回查詢結果中相同的部分。
提示: 待插入圖片必須儲存到oracle主機路徑上。 步驟: 1、SYSDBA許可權使用者建立圖片所在目錄 CREATE OR REPLACE DIRECTORY TEST_DIR AS 'C:\Pictures'; -- 路徑名 "TEST_DIR" 必須為大寫2、授權給操作使用者(scott) GRANT READ,WRITE ON DIRECTORY TEST_DIR TO SCOTT;3、切換操作使用者
一、查看RAC環境 RAC架構,2節點資訊 節點1 SQL> show parameter instance NAME TYPE VALUE ------------------------------------ ----------- ----------------------------------------------- active_instance_count integer cluster_database_instances