Hey guys, forgive me if this is too simple a question. I basically want a count of the number of males and females in a database. So I know two simple queries will accomplish this, such as:
select count(*) from table where gender='male'
select count(*) from table where gender='female'
However, this seems very inefficient since I know that the queries below are both the same query:
select count(*) from table where gender='female'
select count(*) from table where gender<>'male'
Is there an optimal way to retrieve this information, without having to go through each row in the database twice?