標籤:查詢及重複資料刪除記錄的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
標籤:TO_NUMBER(x [, format], [ nls_language ]) converts x to a NUMBER.x is the string that will be converted to a number. x是將要被轉換成number的字串。format, optional, is the format that will be used to convert x to a number. format,可選項,是用來將x轉換成number的格式。
標籤: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為密碼
標籤:查看使用者和預設資料表空間的關係select username,default_tablespace from dba_users;--查看目前使用者能訪問的表select * from user_tables; --Oracle查詢使用者表select * from user_all_tables;--Oracle查詢使用者視圖select * from user_views;--查詢所有函數和儲存過程:select * from