Using an absolute database with this type of database entities will indeed give you this kind of headache problems. i strongly advise against it, but you probably have no choice. So here we go:
Select * from Class JOIN Attribute as TD JOIN Attribute as TS JOIN Attribute as TP WHERE TD.Shortname = "Thread Description" and TD.AttributeValue = "the given description value" WHERE TS.Shortname = "Thread Size" and TS.AttributeValue = "the given size value" WHERE TP.Shortname = "Thread Pitch" and TP.AttributeValue = "the given pitch value"
Since this uses JOIN, this will result in Class only getting added to the result if TD has a value. Same for TS, same for TP.
Still some $ and “ and names will need tweaking, but you get the drift I guess,