mysql - 对于同一个 "callingNumber"记录了多少次唯一的 "CallReasonName"

标签 mysql sql sql-server

我需要您就以下情况提供帮助。我有一个表格,其中有两列“CallingNumber”,其中包含不同的冗余电话号码和“CallReason”,它们记录的原因。

 then i need a query to generate 
     => how many times a unique "callingNumber" is recorded for the same "CallReasonName".

最佳答案

我不知道我是否理解你的意思,但我认为这是一个简单的查询

Select callingNumber, CallReasonName, count(1) as Cnt
from table
Group by callingNumber, CallReasonName

关于mysql - 对于同一个 "callingNumber"记录了多少次唯一的 "CallReasonName",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22892369/

相关文章:

sql - 如何解决 ORA-00937 : not a single-group group function when calculating percentage?

c# - 从 SQL Server 自动填充 smartsheet 中的行

mysql - SQL 联合或其他表连接

MySQL - 按投票排序图像

MySQL 获取没有外键约束的值并比较不同表的日期

php - 如何在mysql中没有group by子句的情况下计算mysql中的总计

mysql - 如何备份MySQL数据库?

sql - 使用参数更新存储过程来自不同表的列名

sql-server - PowerShell获取SQL Server计数器

sql-server - 在 PowerShell 中将字符串拆分为单独的字符串