hello i have a table like this ID ACTION USER 1 success Admin 2 success user2 3 Fail user2 4 Fail user2 5 Fail user2 6 success user2 7 Fail Admin 8 Fail Admin 9 Fail user2 10 Fail user2 11 Fail Admin 12 Fail user2 13 Fail user2 if I want to show by users all the action (success) if the last 3 previous action = fail the result shoud show : --the raw with (id = 1 ==> because the admin in her previous status have 3 fail (id=7, id=8, id=11) --the raw with (id = 2 ==> because the user2 in her previous status have 3 fail (id= 3, id =4, id=5) --the raw with (id = 6 ==> because the user2 in her previous status have 3 fail (id= 9, id=10, id=12) and if I want to show by users all the action (fail) if the last 3 previous action = fail the result shoud show : --the raw with (id = 9 ==> because the user2 in her previous status have 3 fail (id=10, id=12, id= 13 )
... View more