MySQL Group By
Data can be grouped by “group by” key-word.
1 |
group by FieldName; |
tbllibrary table structure and current status of the tbllibrary.
1 |
select * from tbllibrary; |
Group by the writer and count the records for each writer.
1 |
select writer, count(*) from tbllibrary group by writer; |
Explanation
There are four groups by “writer” in the table “tbllibrary”;