sql >> Database teknologi >  >> RDS >> Mysql

mysql-php forespørger på en liste for at bygge en tabel

SELECT  tasks.*, students.*,
        (
        SELECT  grade
        FROM    grades
        WHERE   grades.task_id = tasks.task_id
                AND grades.username = students.username
        ORDER BY
                date DESC
        LIMIT 1
        ) AS lastgrade
FROM    assignments a
JOIN    assignment_tasks at
ON      at.assignmentID = a.assignmentID
JOIN    assignment_students ast
ON      ast.assignmentID = a.assignmentID
JOIN    tasks
ON      tasks.task_id = at.task_id
JOIN    students
ON      students.username = ast.username



  1. MySQL Left Join + Min

  2. Tegnkodningsproblem med PHP Simple HTML DOM Parser

  3. Serialiseringsfejl:Deadlock fundet under forsøg på at få lås

  4. Dvale tidsstempel med tidszone