Код: Выделить всё
'SELECT SUM(students.Earned) AS Theory, QuizTitle from students WHERE students.QuizTitle LIKE 'THEORY%' and students.DriverLicense = 'D120001102'
UNION SELECT SUM(students.Earned) AS Hazmat,QuizTitle from students WHERE students.QuizTitle LIKE 'HAZMAT%' and students.DriverLicense = 'D120001102'
UNION SELECT SUM(students.Earned) AS Pass, QuizTitle from students WHERE students.QuizTitle LIKE 'PASS%' and students.DriverLicense = 'D120001102'
UNION SELECT SUM(students.Earned) AS Bus, QuizTitle from students WHERE students.QuizTitle LIKE 'SCHOOL%' and students.DriverLicense = 'D120001102'
group by DriverLicense'
Подробнее здесь: https://stackoverflow.com/questions/796 ... uery-query