CodePudding user response:
Table structure post, to create table text, again collect rules and and expected results,Or use excel to draw it
CodePudding user response:
CodePudding user response:
The select a.f DeptID sector, A tableCount (distinct a.f Name) A table department number,
Count (1) the total number of A table,
Count (distinct a.f Name)/count (1) A table per capita number,
Count (b. Name) B table total number,
Count (b. Name)/count (distinct b. Name) B table per capita number
The from Question_A a, Handle_B b
Where id=a.f b. id (+)
Group by a.f DeptID;
Default considering no wish, if you have the nuptial need to change the name fName to only personnel identification, such as personnel id or something like that