可能重复:
如何从多个表中获取详细信息?
在 MySql 数据库中有五个表
Course
c_id name course_desc
101 java sometext…..
User
u_id firstname Address
201 ram Hyd
SkillSet
S_id c_id u_id experience course_content
301 101 201 2 somtext…
Timetable
T_id c_id u_id date_time class_duration(H)
401 101 201 2012-08-08 2
Intrest
I_id t_id u_id
501 401 201
我的问题是,我正在传递开始日期和结束日期以及名称(课程名称)然后我想获取详细信息,例如
Name(courseName),course_desc,firstname
select course.c_id,course.course_desc,user.firstname
from COURSE course
inner join SKILLSET skill on skill.course_id=course.c_id
inner join USER user on user.c_id=skill.u_id
inner join TIMETABLE tt on skill.c_id=tt.u_id
where course.name='java'
and tt.date_time BETWEEN '2012-08-07 00:00:00' AND '2012-08-20 00:00:00'
它显示错误..请帮助我...... ...