我有一个表甲骨文 - 选择具有多个条件
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