標籤:SELECT a.areaname as 二級地名 FROM houses h,houses h2,areas a WHERE h.areaid=a.areasid AND h2.areaid=a.areasid AND h.finalassessmentid=1 AND h.houseslevel=2 AND h2.houseslevel=1 AND a.areasid!=a.parentareasid AND a.companysid=2; select * from
標籤:查詢及重複資料刪除記錄的SQL語句 1、尋找表中多餘的重複記錄,重複記錄是根據單個欄位(Id)來判斷 select * from 表 where Id in (select Id from 表 group byId having count(Id) > 1) 2、刪除表中多餘的重複記錄,重複記錄是根據單個欄位(Id)來判斷,只留有rowid最小的記錄 DELETE from 表 WHERE (id) IN ( SELECT id FROM 表
標籤:SELECT a.areaname as 二級地名 FROM houses h,houses h2,areas a WHERE h.areaid=a.areasid AND h2.areaid=a.areasid AND h.finalassessmentid=1 AND h.houseslevel=2 AND h2.houseslevel=1 AND a.areasid!=a.parentareasid AND a.companysid=2; select * from
標籤:1.建立使用者SQL> -- 例如建立一個使用者名稱為xiaoming,密碼為a123的使用者SQL> create user xiaomingidentified by a123; 使用者已建立。 SQL> show userUSER 為 "SYS" 2.給使用者授予許可權SQL> -- 給使用者xiaoming授予許可權SQL> grant connect,resource,dba to
標籤:密碼1 conn / as sysdba2 alter user system identified by Abcd1234; manual script first -->manual_script_before_install.sql 1 -- must connect as sysdba to execute the following script 2 -- this manual script is to minimize the
標籤:1.複製表結構和表資料create table table_new as select * from table_old2.複製表結構create table table_new as select * from table_old where 1<>13.複製表的指定欄位create table table_new as select o.column1,o.column2 from table_old o where
標籤:Oracle資料表空間和使用者的建立1、plsql中,使用管理員賬戶登入2、create tablespace test datafile ‘D:\test.ora‘ size 1000m;--建立資料表空間,test為資料表空間名稱3、create user test identified by test default tablespace test quota 500m on users;--建立使用者 --第一個test為使用者名稱 --第二個test為密碼
標籤:1、從表中隨機取記錄 select * from (select * from staff order by dbms_random.random) where rownum < 4 表示從STAFF表中隨機取3條記錄2、產生隨機數 SELECT DBMS_RANDOM.RANDOM FROM DUAL; 產生一個任意大小的隨機數 SELECT ABS(MOD(DBMS_RANDOM.RANDOM,100))
標籤:sqlldr enclosed by Oracle Sqlldr optionally enclosed by(GCH)In all, when you edit the control file,you would rather add theclause “optionally enclosed by” inensurance.The following example is that not use the
標籤:dataguard switchover 1.檢查主庫的狀態:SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;SWITCHOVER_STATUS--------------------TO STANDBY2.將主庫設定為standby role alter database commit to switchover to physical