Count register with a condition
Posted on 2005-04-18
I have a table with 2 fields: IDpierna and IDaltura
I need to know how many registrations they exist with the same IDpierna and IDaltura.
He/she would need to obtain:
For IDpierna = 1
IDaltura =1 are 3 registers.
IDaltura = 2 are 2 registers.
IDaltura =3 are 1 register.
I also need to keep in variables The IDpierna that have register and for each IDpierna that has registrations the IDaltura that in turn have registers..
The program should show the data
IDpierna = x
IDaltura A1 = x1
IDAltura A2 = x2
IDaltura A3 = x3
Being x the regiser IDpierna = 1 and A1 the registrations with IDpierna = 1 and IDaltura = 1, A2 the registrations with IDpierna = 1 and IDaltura = 2.......
And this way for all the table.