[SOLVED] I need the query to return the amount of each ceoModel_id present in the table below, something that would look like:

Issue

| ceoModel_id | Qt_ceoModel |
|:----------- |------------:|
| 2           | 1           |
| 3           | 2           |
| 4           | 2           |

original table

Solution

select ceoModel_id, 
       count(ceoModel_id) as Qt_ceoModel
from   inventory_ceos
group by ceoModel_id;

This works?

Answered By – Darshit Parmar

Answer Checked By – Terry (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.