oracle資料庫相關操作

2021-08-21 07:44:17 字數 722 閱讀 2852

查詢兩個欄位的重複資料:

select * from a1 a where a.rowid <> (select max(b.rowid) from a1 b where a.cldbh=b.cldbh and a.sjsj= b.sjsj);

rowid是資料的詳細位址,通過rowid,oracle可以快速的定位某行具體的資料的位置。

rowid可以分為物理rowid和邏輯rowid兩種。普通的堆表中的rowid是物理rowid,索引組織表(iot)的rowid是邏輯rowid。oracle提供了一種urowid的資料型別,同時支援物理和邏輯rowid。

物理rowid又分為擴充套件rowid(extended rowid)和限制rowid(restricted rowid)兩種格式。限制rowid主要是oracle7以前的rowid格式,現在已經不再使用,保留該型別只是為了相容性。

1.建立一臨時表

create table test_rowid (id number, row_id rowid);

2.插入一行記錄

insert into test_rowid values(1,null);

3.修改剛插入的記錄

update test_rowid set row_id = rowid where id = 1;

4.檢視rowid

select rowid,row_id from test_rowid;

oracle資料庫相關操作

最近公司乙個專案要遷移到oracle資料庫,發現oracle與mysql操作有很多不同,記錄一下 獲取系統時間 mysql newdate sqlserver sysdatetime oracle sysdate ora 00911 無效字元 在mybatis中寫oracle sql,末尾不要加分號...

資料庫操作相關

nativcat premium是乙個很好用的工具可以操作多種資料庫,即使本地沒有安裝資料庫也可以進行操作 貌似 使用nativcat premium將mysql資料匯入到oracle 1 工具 資料傳輸 將mysql的表匯出 目標選檔案 匯出為.sql格式 2 在oracle資料庫中 右鍵表,選擇...

Oracle 資料庫資料的匯入匯出相關操作

檢視表空間 select tablespace name,bytes 1024 1024 file size mb,file name from dba data files 建立表空間 create tablespace testtablespacename logging datafile c ...