dept_name,dept_attribute,dept_attributevalue
Dept1 A 10
Dept1 A 20
Dept1 B 20
Dept1 C 10
Dept1 C 30
Dept1 D 10
Dept2 B 10
Dept2 C 10
Dept2 D 10
Dept3 A 10
Dept3 B 20
Dept3 C 10
Dept3 D 20
Dept3 E 20
我现在要找具有(attribute=A and (value=10 or value =20)) 且(attribute=B and (value=20))的部门
结果是dept1,dept3
怎么用sql写出来呢?
谢谢