我有一個包含4列和數千條記錄的表。我想刪除基於三列(如col1,col2,col3)重複的行。 我不得不刪除像在oracle中刪除重複的列
1) found a row which has col1 and col2 equal and
2) in those duplicate record i have to delete those rows on which col3 is null- keep one row
(if no other record with combination of col1 and col2 doesn't have not null col3)
col1 col2 col3
---- ---- ----
1 1 null
1 1 null
1 2 null
1 2 1
1 2 1
1 2 null
1 2 2
1 2 3
基於標準排在這個例子中,我想刪除1或2。3,4,5,6有重複列,其中一些具有第三列不爲空我想只保留一個具有第三列不爲空(如果第三列也等於只保留一行)一行
這甚至不通過對Oracle的語法檢查,也沒有查詢「> rowid」有任何意義。 – GWu 2012-07-20 15:15:31
很明顯,&&的意思是「AND」,與ROWID的比較意味着只需選擇具有匹配列的一組記錄中的一個。 – 2012-07-23 15:00:51