|
Hey, I'm new to using sql*plus (I'm learning it at uni)
the tables im working with are structured in the following way:
Suppliers Table has fields:
"SuppCode" and "SuppName"
Stocks Table has fields:
"StoreCode", "Description", "Quantity", "Units", "ReorderLevel", "Price", "SuppCode"
I have to write a query which displays the SuppName for all the suppliers which supply at least 4 stores.
I already have the following part-query which displays the SuppCode for the correct Suppliers, but I don't know how to then display the SuppName for the corresponding SuppCode's.
My query so far is:
Select SuppCode, COUNT(Distinct StoreCode)
From Stocks
Group By SuppCode
Having COUNT(Distinct StoreCode) >= 4;
Any help/hints would be greatly appreciated. Thanks in advance, Simon
|