如何合并两个表并根据ID和子表中未引用的ID获取值

时间:2019-05-09 11:49:22

标签: mysql laravel-5

这是我尝试过的查询

SELECT
applicants.Name,
GROUP_CONCAT(
    educationreference.SubjectPassed
) AS `Subject`,
GROUP_CONCAT(educationreference.College) AS `College`,
GROUP_CONCAT(
    YEAR(
        educationreference.DateObtained
    )
) AS `Date`
FROM
applicants,
educationreference
WHERE
applicants.PersonId = educationreference.PersonId
GROUP BY
applicants.PersonId

0 个答案:

没有答案