我有一個表甲骨文 - 選擇具有多個條件
NAME ID ORIGSSID$
------------------------------ ----- ---------
Reproducibility Renamed 2 1287 1088
Reproducibility Renamed 1284 1088
NoiseDrift 1049 1049
Reproducibility_8h 1131 1131
Reproducibility 1088 1088
Noise and Drift 1263 1049
我需要基於兩個標準來選擇行:
- 如果
ID
和ORIGSSID$
都是平等的,COUNT(ORIGSSID$) == 1
OR
- 如果有多個條目具有相同
ORIGSSID$
選擇一個具有最大ID
預期的結果是:
NAME ID ORIGSSID$
------------------------------ ----- ---------
Reproducibility Renamed 2 1287 1088
Reproducibility_8h 1131 1131
Noise and Drift 1263 1049
請幫我構建SELECT表達式..
我認爲1049/1049也應該在結果中,根據你的規則。 –
謝謝Gordon,更具體一點1.如果'ID == ORIGSSID $'和'count(ORIGSSID $)== 1',那麼1049/1049應該不符合我的標準 – Alexander