-1
に2つ目のテーブルのJOIN:は、既存の作業例に別のテーブルを結合するために探して実施例
ワーキングSQL:
SELECT u.UserName, u.LastName
, (e.UserName IS NOT NULL) as user_exists_in_EnrollmentsTbl
FROM UsersDataTbl u
LEFT
JOIN EnrollmentsTbl e
ON u.UserName = e.UserName
AND e.ClassName LIKE 'Word%'
WHERE u.Career = 1 AND Active = 1 ORDER BY u.LastName
私の試みを:
(SELECT u.UserName, u.LastName, d.Station
, (e.UserName IS NOT NULL) as completedl
FROM UsersDataTbl u
LEFT
JOIN EnrollmentsTbl e
ON u.UserName = e.UserName
AND e.ClassName LIKE 'Word%')
INNER JOIN UsersDataCareerTbl d
ON u.UserName = d.UserName
WHERE u.Career = 1 AND Active = 1 ORDER BY u.LastName
正確には何をしようとしていますかここで達成するには? – Shadow
既存の 'UsersDataCareerTbl'に参加し、結果の' Station'を取得します – BarclayVision