I’m currently working with Oracle lately and I’m stuck on something.
I have been asked to:
Display the names of those suppliers who have supplied to at least 4 stores.
Here is my query:
select SuppCode
from Stocks
group by SuppCode
having COUNT(DISTINCT StoreCode)>=4
order by SuppCode desc;
and I’m getting the correct SuppCode:
SUPPCO
------
S3
But the SuppName is in another table. How would I change the SuppCode from Stocks, to SuppName from Suppliers, whilst keeping the rest of the query which gives me the correct answer. The only problem is that it’s displaying the SuppCode, and not the SuppName which is in Suppliers.
Any help would be appreciated, thanks.
1 Answer