This query brings me the information correctly with the difference that it brings me the duplicates, so what I want to do is another column where it tells me how many times the same number is repeated in this case the repeated ones are here (E.N_PARTE) example of what bring back
E.N_PARTE
AAA
AAA
BBB
CCC
BBB
What I want is to add another column where
Repetidos E.N_PARTE
2 AAA
2 BBB
1 CCC
SELECT E.NOM_ALMACENISTA, E.N_PARTE, E.DESCRIPCION, E.INV_MINIMO,
E.INV_MAXIMO, E.INV_EXISTE, E.COS_UNIDLLS,HT.FCH_REGISTRO
FROM ELENTRADAS AS E LEFT OUTER JOIN
HISTORIAL AS HT ON HT.NUM_PART = E.N_PARTE
WHERE (HT.FCH_REGISTRO BETWEEN '2018-08-24' AND '2018-08-24') AND (E.DEPART
= 'Departamento1' )
order by HT.FCH_REGISTRO ASC
Thanks for your help.
You have to add a group by at the end like in the following example
You also have to keep in mind that the arguments you put in the select do not conflict with the group by.
What you have to do is group by the field you want and then count that field and it will give you the number of repeating records for that Field