user_id | raisedtime | cleartime | duration |
---|---|---|---|
3_dsr | 2022-07-22 | 2022-07-23 | 20 |
3_dsr | 2022-07-22 | 2022-07-24 | 22 |
1_DSR | 2022-07-24 | 2022-07-26 | 21 |
1_DSR | 2022-07-24 | 2022-07-26 | 21 |
I tried this and cant get further with this
select user_id,raisedtime, max(duration) as md
from alarms
group by user_id,raisedtime
having count(*)>1