1
Staff need a help in creating a query.
I have a chart that ranks people per week.
PessoaId | Semana | Grupo ---------------------------- 1 | 1 | 1 1 | 2 | 1 1 | 3 | 1 1 | 4 | 1 2 | 1 | 1 2 | 2 | 2 2 | 3 | 2 2 | 4 | 1 3 | 1 | 2 3 | 2 | 2 3 | 3 | 2 3 | 4 | 2
I need a query to count how many weeks they were out of group 1 and/or how many weeks ago they were out of group 1. This week by week.
Result wanted more or less like this
PessoaId | Semana | Tempo Fora ---------------------------------- 1 | 1 | 0 1 | 2 | 0 1 | 3 | 0 1 | 4 | 0 2 | 1 | 0 2 | 2 | 1 2 | 3 | 2 2 | 4 | 0 3 | 1 | 1 3 | 2 | 2 3 | 3 | 3 3 | 4 | 4
How to know the person is not in the group that week?
– EmanuelF
When you’re in group 2.
– Juliano Paz Moreira