False King
False King

Reputation: 37

how do I have two limiters for a database table

If I have a table that looks like this: enter image description here

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

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270443

You are looking for and:

SELECT `FIRSTNAME`, `MIDINIT`, `LASTNAME`, `PHONE`, `SEX`
FROM `emp`
WHERE `SEX` = 'F' AND `JOB` = 'OPERATOR';

Upvotes: 2

Related Questions