Ich habe eine Tabelle wie diese und ich brauche nur UserId 11, weil UserId 12 keine lessonId 103 ist, aber immer noch Ergebnis.T-SQL: ähnliche ID in derselben Spalte
SELECT *
FROM LessonList
WHERE
(LessonId = 102 and LessonValue = 1002)
or
(LessonId = 103 and LessonValue = 1003)
or
(LessonId = 102 and LessonValue = 1008)
Ausgang:
Id UserId LessonId LessonValue
1 11 102 1002
2 11 103 1003
3 12 102 1008
ich so führen müssen:
Id UserId LessonId LessonValue
1 11 102 1002
2 11 103 1003
Dank