Mysql query problem

后端 未结 8 960
逝去的感伤
逝去的感伤 2020-12-22 03:24

I have a problem with my mysql query.

My database:

sections
id
section_name

grades
id
user_id
section_id
date
grade

I want my data

8条回答
  •  臣服心动
    2020-12-22 04:05

    SELECT grades.*,sections.* 
     FROM grades inner join sections on grades.sections_id = sections.id 
     where grades.user_id = '.$id.' 
     GROUP BY grades.section_id 
     ORDER BY grades.date DESC
    

    you can use this it is working 100%

提交回复
热议问题