Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL Group By within Category

How can we use group by within separate categories? That is treat each category as it’s own group and then group by something else within the category.

For instance in this Image, I would like to group by quarter only within a particular ISSN. https://i.stack.imgur.com/1QUIk.png

Expected result would be

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

It is possible to group by more than one column:

select issn, quarter, count(*)
from t
group by issn, quarter
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading