Wie man einen SQL-Komplex auswählt Abfrage wo Bedingung und oder [geschlossen]
Meine Tabelle ist
ID ATTRID VALSTR
1771373 1 1234
1771373 3 510
1771373 7 2016
1771373 8 05
1777623 3 5003
1777623 7 2016
1777623 8 05
1778103 3 520
1778103 7 2016
1778103 8 06
Ich möchte Bedingung @ auswähl
AttrId = 3 AND ValStr = 510
AttrId = 7 AND ValStr = 2016
AttrId = 8 AND ValStr = 05
Ich schreibe dies, aber nicht richtig ausgeführt
SELECT *
FROM Table
WHERE ((AttrID = 3 AND ValStr ='510') OR
(AttrID = 7 AND ValStr ='2016') OR
(AttrID = 8 AND ValStr ='05')
) AND
DefID = 1375552
Wie schreibe ich diese Abfrage? Können Sie mir bitte helfen?