A table has two fields. one is "empcode" and other one is enum "Gender" which has 2 values say "Male" & "Female".
If there is one record with empcode "0003" of gender "Male" in the system. When user tries to create one more record in system with same empcode "0003" and same Gender "Male" then, system should not accept it.
How to write the code so that it throws error message "Record already exists".
But if empcode is same and Gender is not same then it should accept.