- or download this
select common.dbo.states.full_name, count(customers.*)
from customers
join common.dbo.states on customers.ST = common.dbo.states.ST
group by common.dbo.states.full_name
order by common.dbo.states.full_name
- or download this
create view states
as select ST, full_name from common.dbo.states
- or download this
select states.full_name, count(customers.*)
from customers
join states on customers.ST = states.ST
group by states.full_name
order by states.full_name