an error, eh?
perhaps you might share with us what that error was
in any case, the query will not produce any results
the WHERE clause specifies that each tbl_relation.CODE value must be equal to three different values at the same time
clearly, this is impossible
however, if you change the ANDs to ORs, then the WHERE clause makes sense
but the ON clause of the join suffers from the same problem
you want tbl_relation.CODENAME to be equal to three different tbl_employee column values
clearly, this is only possible when those three values are all equal to each other
and GENDER = INTEREST = YEARIN, while not strictly impossible, doesn't make much sense either