CodePudding user response:
(1) SELECT A.A CCOUNT, USERS=COUNT (B.T ELEPHONE), RENT=SUM (A.R ENT), FEE01=SUM (b. EE01), FEE02=SUM (b. EE02), FEE03=SUM (b. EE03), FEE04=SUM (b. EE04)
FROM the USER A
The JOIN at B
ON A.T ELEPHONE=B.T ELEPHONE
GROUP BY A.A CCOUNT
(2) SELECT A.A CCOUNT
FROM the USER A
The JOIN at B
ON A.T ELEPHONE=B.T ELEPHONE
GROUP BY A.A CCOUNT
HAVING a COUNT (B.T ELEPHONE) & gt; 3
(3). SELECT A.T ELEPHONE
FROM the USER A
The JOIN at B
ON A.T ELEPHONE=B.T ELEPHONE
The WHERE (b. EE01 + b. EE02 + b. EE03 + b. EE04) & gt; A.R ENT * 1.5
CodePudding user response:
With the explain command to have a look at this statement,Look at the 2 table index,
CodePudding user response: