简体   繁体   English

计算来自不同表的特定值的行,两个表都包含同一列?

[英]count rows for particular value from different table both table contains one same column?

Account(Acc_no, branch_name,balance)
Depositor(cust_name,Acc_no)

Find no. 找到没有。 of depositors at each branch? 每个分行的存款人数目?

SELECT A.branch_name, COUNT(D.cust_name) FROM Account A INNER JOIN Depositor D GROUP BY A.branch_name

希望这可以帮助

从ACCOUNT.ACC_NO = DEPOSITOR.ACC_NO GROUP BY BRANCH_NAME的ACCOUNT内部联接存款人中选择ACCOUNT.BRANCH_NAME,COUNT(DEPOSITOR.CUST_NAME);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何创建一个表,其中一列包含具有不同ID的所有行的相同值?(有关说明,请参见布局) - How to create a table where one column contains a same value for all rows with different id?(See Layout for clarity) 如何在一个sql表中计算来自同一字段的不同行 - how to count different rows from the same field in one sql table 如果某一列包含特定值,则选择具有相同ID的所有行 - Select all rows with same IDs if one column contains a particular value Laravel从同一个表中选择3行,并为指定列指定不同的值 - Laravel select 3 rows from the same table with different value for a specified column 如何从表中获取总行数和特定值的计数? - How to get the count of total no of rows and count of a particular value from a table? 计算一个表中的不同行 - Count different rows from one table 从表中选择行,其中具有相同id的另一个表中的行在另一列中具有特定值 - Select rows from a table where row in another table with same id has a particular value in another column 选择表中具有相同表中不同列的值的条件的行 - Select rows in table with condition of value of different column in same table 从表中获取在同一列中具有两个变量的所有行 - get all rows from table that have both variables in a same column Mysql 用同一表列的计数更新所有行值 - Mysql update all rows value with count of same table column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM