[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
SqlGroupBy
You can also count the age groups:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
SqlGroupBy
(SQL) group by
Command to group query results and/or get unique rows.select * from database where gender = 'female' group by age
/* Example output: */ /* The youngest female is 16, the oldest 20 years old */ 16 17 18 19 20
You can also count the age groups:
select *, count(*) from database where gender = 'female' group by age
/* Example output: */ /* The youngest female is 16, the oldest 20 years old */ /* The females' ages have a gaussian distribution */ 16 12 17 25 18 50 19 25 20 12
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
