I wanted to get a query to return the "question number" according to the following parameters:
That it meets: -What idUser = 1 -What mode? Questions? Operator of Services - That the last 4 times that has been answered has had as a value the answersRight = 1 (4 times in a row the value 1 without interleaving with 0)
Table:
What I get to is the following, but I get all those that met the concidiniones, have as value of answers Correct = 1, but what I need is that the last 4 answers have had followed the value 1. (Since in the logic of the program, it is understood that if the user answers a question 4 times in a row (value 1), he has learned the answer and does not want that question to come up again in the program).
This to which I have come, is not enough:
SELECT numeroPregunta
FROM 'respuestasTestUsuario'
WHERE idUsuario=1 AND modalidadPreguntas ='operarioDeServicios'
AND respuestasCorrectas=1
Thank you very much!