I'm having a question when setting up a query.
I'll set up a fictional scenario to demonstrate.
I have the quantidadeQuestoes
table with the fields:
- cod_level
- cod_category
- cod_dificulty
- quantity
And I have the questoes
table with the fields:
- cod_level
- cod_category
- cod_dificulty
- description
My doubt is. How to get from the% wrapper% table the amount specified in the% wrapper% field of the wrapper% wrapper where the other fields are matched.
With my current query I'm picking up all the items and not just the amount specified in the Quantity field, which is what I need:
SELECT
qt.descricao
FROM
quantidadeQuestoes qq
INNER JOIN
questoes qt ON
qq.cod_nivel = qt.cod_nivel AND
qq.cod_categoria = qt.cod_categoria AND
qq.cod_dificuldade = qt.cod_dificuldade
It is for me to put together a test that contains so many questions of a level + category + difficulty.