SELECT country, nvl( state,'Undefined') state, count(*) customers from hz_parties WHERE party_type='ORGANIZATION' group by country, state order by customers desc
View Text - HTML Formatted
SELECT COUNTRY , NVL( STATE , 'UNDEFINED') STATE , COUNT(*) CUSTOMERS FROM HZ_PARTIES WHERE PARTY_TYPE='ORGANIZATION' GROUP BY COUNTRY , STATE ORDER BY CUSTOMERS DESC