mercredi 2 mars 2016

is it possible to do this in SQL?

MEMBERS TABLE:

 ID Resident    Gender      Location

1   Steve       M       S-55
2   Roger       M       S-42
3   Martha      F       R-20
4   Samantha    F       CC
5   Tom         M       S-12

Trying to code an SQL Statement that returns a single numerical value.

Something along the lines of...

SELECT COUNT(Gender) 
FROM Members
WHERE GENDER = M 
   AND Location CONTAINS 'S%'

The AND LOCATION obviously doesn't really exists in SQL in that syntax, but I'm hopping to get the count of how many members that are MALE and reside in a location that has an S in it.

Is this possible?

Aucun commentaire:

Enregistrer un commentaire