假设我们有桌子
Order(customerId,orderDetails...)
Customer(Id, customerDetails...)
查询 Count(customer)xCount(order) 对的最简单方法是什么?
例子
顾客:
ID | Name
---------
1 | Bob
2 | Ann
命令
CustomerId | Address
--------------------
1 | Block1
1 | Block2
1 | Block1
2 | Home Address
想要得到
CustomerCount | OrderCount
--------------------------
1 | 3
1 | 1