Home > database >  A new small white o SQL
A new small white o SQL

Time:09-19

Isn't interested in water to stick, general data is that the form of A code data to match the form of B data, and then find A duplicate values, and then look at the people forward B in the third column is the data in the table is greater than 1, if more than 1 just calculate A human activity, and then according to the first column of agencies export A total,

CodePudding user response:

Select institutions, b. b. code, b. number from where b. b code in (select a. code from a) and b. number 1 & gt;

CodePudding user response:

Use this try, I am also a small white

CodePudding user response:

Brother, I tried not goozyet

CodePudding user response:

Select b. institutions, count (*). B. the as number from a, b, where a. Code=b. code and b. number & gt; 1 group by b. institutions

CodePudding user response:

 
SELECT b. institutions, the COUNT number (b.)
FROM a AS a
INNER JOIN AS b ON a. b code=b. code and b. number & gt; 1
GROUP BY b. agency

CodePudding user response:

reference 4 floor Hello__World1994 response:
select b. institutions, count (*). B. the as number from a, b, where a. Code=b. code and b. number & gt; 1 group by b. agency

Thank you, the code can be solved

CodePudding user response:

refer to the fifth floor the rain stopped response:
 
SELECT b. institutions, the COUNT number (b.)
FROM a AS a
INNER JOIN AS b ON a. b code=b. code and b. number & gt; 1
GROUP BY b. agency

Thank you, this can also, thank you
  • Related