I have 3 tables: AuditCheckCriteria as T1, Learners as T2 & LearnerAuditRegistrations as T3 with the following structure:
T1: CheckID CheckName
1 'Stage One'
2 'Stage Two'
3 'Stage Three'
T2 LearnerID LearnerName
10 'John'
11 'Peter'
12 'Paul'
T3: LearnerAuditID LearnerID CheckID
1 10 1
2 10 2
3 11 1
4 11 2
5 11 3
I want the following output:
T2.LearnerID, T1.CheckID, T3.CheckID
10 1 1
10 2 2
10 3 NULL
11 1 1
11 2 2
11 3 3
12 1 NULL
12 2 NULL
12 3 NULL
(T2 & T3 contain over 20000 rows each)
Any help is appreciated!