0

我正在尝试计算每个 C.ID 的 B.ID。

到目前为止,我得到以下信息:

在此处输入图像描述

Select
C.ID,
COUNT(Distinct B.ID)AS 'Total bookings'

FROM Client C

inner join Booking B on B.ClientID=C.ID

Where ClientID = '594861'

Group by C.ID
4

1 回答 1

0

问题出在我的 Group by 身上!

Select
C.ID,
COUNT(Distinct B.ID)AS 'Total bookings'

FROM Client C

inner join Booking B on B.ClientID=C.ID

Where ClientID = '594861'

Group by C.ID
于 2013-09-19T08:32:57.223 回答