Reputation: 37
If I have a table that looks like this:
I'm aware of how to make the table list information for only male employees by doing something like this:
SELECT `EMPNO`, `FIRSTNAME`, `MIDINIT`, `LASTNAME`, `WORKDEPT`, `PHONE`, `HIREDATE`, `JOB`, `EDUCATION`, `SEX`, `BIRTHDATE`, `SALARY` FROM `emp` WHERE `SEX` = 'M'
However, lets say I want to display only information from female employees that have the job operator. It wont work when I format it like this and I'm not sure of another way to do it:
SELECT `FIRSTNAME`, `MIDINIT`, `LASTNAME`, `PHONE`, `SEX` FROM `emp` WHERE `SEX` = 'F', `JOB` = 'OPERATOR'
Upvotes: 0
Views: 21
Reputation: 1270443
You are looking for and
:
SELECT `FIRSTNAME`, `MIDINIT`, `LASTNAME`, `PHONE`, `SEX`
FROM `emp`
WHERE `SEX` = 'F' AND `JOB` = 'OPERATOR';
Upvotes: 2