好复杂的问题!
把这个拿去试试!
SELECT SUM(attend_grade) as d FROM attend,student_attend,student WHERE attend.strid=student_attend.strid and student_attend.strid=student.strid and student_attend.date=#2010-5-24# and student.student_id=(SELECT top 1 student.student_id FROM student WHERE student.student_name='fengmnll')
上面写错字段名了,应该是这个:
SELECT SUM(attend_grade) as d FROM attend,student_attend,student WHERE attend.attend_id=student_attend.attend_id and student_attend.student_id=student.student_id and student_attend.attend_date=#2010-5-24# and student.student_id=(SELECT top 1 student.student_id FROM student WHERE student.student_name='fengmnll')