I'm writing a code for MySQL search using two tables. But the results seems not correct
"interpreters" Table Structure (This hold the info about interpreters)
"terp_attributes" Table structure (This holds the attributes value ids available for terps)
EX- terp x has level 1 and level 2 certification
Ex2- terp x can translate ASL and Spanish
Sample data on above table
I wrote a sql to get "Male or Female which has Certified (ta_attrvalid=1) or Level 1 Skills (ta_attrvalid=2)" and He also has "ASL" language (ta_attrvalid=6) attribute but it seems not working even i modified a lot. here is my query
SELECT * FROM
interpreters ,terp_attributes
WHERE (terp_gender='M' OR terp_gender='F')
AND terp_agencyid=1 AND terp_id=ta_terpid
AND ( ta_attrvalid=1 OR ta_attrvalid=2)
AND ( ta_attrvalid=6)
Which should return "ta_terpid 3" data as the prediction but i cannot see any results
can anyone help me to resolve this query please, Thanks a lot



AND ( ta_attrvalid=1 OR ta_attrvalid=2) AND ( ta_attrvalid=6)- This is not possible.EXISTSsubqueries.