【发布时间】:2018-12-04 17:54:25
【问题描述】:
我需要一些帮助来过滤具有相同 uuid 的不同帐户状态的此表,并保留至少一个状态为活动的所有 uuid
样本数据:
UUID Status
1 Active
1 Rejected
1 Rejected
2 Rejected
2 Waitlisted
2 Processing
3 Active
3 Active
3 Processing
4 Rejected
4 Processing
预期输出:
UUID Status
1 Active
1 Rejected
1 Rejected
3 Active
3 Active
3 Processing
我正在尝试使用某种 RANK 函数,但我没有找到一种方法来维护具有 Active 的 UUID 但状态不是 Active 的行。
谢谢
【问题讨论】:
标签: postgresql filtering