I got stuck with a script, I show you what I have so far.
I have two tables, historial_numeros
and historial_loterias
I have to count the ones that have the column cod=1
, the problem arises, that they can have different codes for each lottery.
Where I get stuck is that I need him to id_historial_numero
=7
mark only one row, not two, in the example I have, only the row with the
cod=1
In the last image I leave the query I have so far.
I thank you in advance for your help.
Hello, if this is the expected result, you could consider using the query that I relate.
Cheers
In this part of the query, it performed the COUNT and with this result it performed the join with the other tables.