I have a MySQL User table with a column for Gender - 1 Male & 0 Female. Each Users has a Gender.
I want to be able to return a percentage of male/female when I say return 100 Users. EG: 40 Accounts Male and 60 Accounts Female - 40/60 Split.
How can I do this with MySQL?
select * from users where gender?
If you specifically want to get 40 males and 60 females, then use
(select u.* from users u where u.gender = 'male' limit 40 ) union all (select u.* from users u where u.gender = 'female' limit 40 );