C
circuit_breaker
Hi,
From a table which contains Users (Un), HostNames(Hn) and Files(Fn),
I'd like to know how many HostNames and how many Files belongs to each
user. Each user can have multiple HostNames and Files.
Data Set:
USER HOST FILE
--------------------
U1 H1 F1
U1 H1 F2
U1 H1 F3
U1 H2 F1
U1 H2 F3
U1 H2 F4
U2 H5 F1
U2 H6 F6
U2 H7 F6
U2 H7 F2
Expected Results:
USER HostCnt FilesCnt
---------------------
U1 2 4
U2 3 3
I tried Unions, Joins, imbedded SELECT but it either doesn't work or
it times out.
Thanks for your help.
From a table which contains Users (Un), HostNames(Hn) and Files(Fn),
I'd like to know how many HostNames and how many Files belongs to each
user. Each user can have multiple HostNames and Files.
Data Set:
USER HOST FILE
--------------------
U1 H1 F1
U1 H1 F2
U1 H1 F3
U1 H2 F1
U1 H2 F3
U1 H2 F4
U2 H5 F1
U2 H6 F6
U2 H7 F6
U2 H7 F2
Expected Results:
USER HostCnt FilesCnt
---------------------
U1 2 4
U2 3 3
I tried Unions, Joins, imbedded SELECT but it either doesn't work or
it times out.
Thanks for your help.