Dear reader
I have 1 table with several data, example
-----------------------------
Code:
tblData
Acol1 Acol2 Acol3
hey A 1.5
hey A 4.5
hey A 4.5
jo C 1.5
jo C 6
jo C 6
hey B 2
hey B 5
hey B 8
hey B 2
hey B 5
------------------------------
I want an output like this where based on the key combination of Acol1 AND Acol2 the unique/distinct values of Acol3 is counted, Acol4counts the number of times Acol1 and Acol2 is present AFTER Acol3 having all unique values. SO how to SQL this?
Code:
Acol1 Acol2 Acol3 Acol4
hey A 1.5 2
hey A 4.5 2
jo C 1.5 2
jo C 6 2
hey B 2 3
hey B 5 3
hey B 8 3
Anyone have any idea? I made already some complex sql statements for vb2010 but somehow this i cant accomplish... i want to achieve the above thing into one SQL statement for use in a vb2010 programm
thx for your attention