0

嘿伙计们,我正在尝试总结这些表格,但我不知道我做错了什么

我的第一张桌子是:

Reserve
ReserveID   MembershipID   PlayerCount   Time    CourseID

我的第二张桌子是

Courses
CourseID   Name

我正在尝试的 sql 语句在这里:

Select Sum(Reserve.Player_Count)Total
From Reserve 
Left Join Courses 
On Courses.CourseID = Reserve.ReserveID 
Where Time = "2012-04-09 07:10:00" 
And Courses.Name = "Lake" (or I had Courses.CourseId = "1")
4

1 回答 1

0

你似乎在混合别名。避免他们

Select Sum(Reserve.Player_Count)Total
From Reserve 
Left Join Courses 
On Courses.CourseID = Reserve.ReserveID 
Where Reserve.Time = "2012-04-09 07:10:00" 
--     ^ Right here  
And Courses.Name = "Lake" (or I had Courses.CourseId = "1")
于 2012-04-10T23:40:27.947 回答