I have a structure role_approvers
:
id, role_id, level, user_id, approval_date
Rows:
4116, 1300, 1, 1158, 2021-05-28 14:24:34
4117, 1300, 1, 1186, NULL
4596, 1300, 2, 21, NULL
I need to get MIN level where role_id = 1300 and ALL approval_date on this level should be NULL
So in this case I need to get level = 2, but I don't know how to get it, can someone help with a query