在MySql數據庫必須在如何從多個表中獲取詳細信息?
cId CourseName course_desc
101 java sometext...
102 mysql sometext....
:
AM_USER
AM_COURSE
表在
uid name
1001 Ram
1002 pavan
在
id uid cid
1 1001 101
2 1001 102
3 1002 101
AM_TIMETABLE
表AM_INTER
在
UserId Date_Time
101 2012-08-08 04:00:00
102 2012-08-15 10:00:00
103 2012-08-18 09:00:00
104 2012-08-24 05:00:00
我的問題是,我傳遞開始日期和結束日期和CourseName
然後我想得到這樣用戶id,名,coursename,course_desc那樣我寫查詢
SELECT a.cid,a.course_desc,c.name
FROM
AM_COURSE a,AM_USER c INNER JOIN AM_TIMETABLE b ON a.S_ID = b.COURSE_ID WHERE
a.Name = 'java'
AND
b.Date_Time BETWEEN '2012-08-07 00:00:00' AND '2012-08-20 00:00:00'
但我的詳細信息米得到錯誤please help