【发布时间】:2019-09-24 15:08:35
【问题描述】:
表格如下:
Request# type status
123 R partially complete
123 S complete
345 S partially complete
345 S complete
R 表示短请求,S 表示长请求。当状态为“完成”时,每个请求类型都会变为 S。我需要找到所有已完成的“R”类型的请求
select *
from table
where type ='R' and status='partially complete' OR
type ='s' and status='complete'
预期结果
Request# type
123 R
【问题讨论】:
标签: sql oracle group-by aggregation