^ HOSPITAL_SPECIALISE_TEST ^
Here are my 2 tables. I'm trying to use inner join to generate a result and this is the query I currently use :
SELECT HOSPITAL_ID, COUNT(DISTINCT SPECIALISE) AS SPECIALISE FROM HOSPITAL_SPECIALISE_TEST GROUP BY HOSPITAL_ID;
And I get the result below...
Now here is the question, I want to join both tables and display hospital name, but it fails to generate and I don't know why... Here is my query:
SELECT HS.HOSPITAL_ID, HP.NAME, COUNT(DISTINCT HS.SPECIALISE) AS SPECIALISE
FROM HOSPITAL_SPECIALISE_TEST HS
INNER JOIN HOSPITAL HP
on HS.HOSPITAL_ID = HP.HOSPITAL_ID
GROUP BY HOSPITAL_ID;


