i have this query which i get correct data.now i want to know can i change this query to iterate co_id from 1 to the last co_id and return all the values.rather me entering co_id for each of the co_id in the table.
Select a.NAME, count( b.TERMINAL_ID) AS Value
from Portal_State a
join Terminal_Ports b on a.STATE_ID = b.PORTAL_STATE_ID
join Terminals c on b.TERMINAL_ID = c.TERMINAL_ID
and CO_ID = 2
group by a.STATE_ID, a.NAME
order by STATE_ID