I have two tables as follows..

and the data in these tables is as follows

I want to write a query to display DrugName Instead of FKDrugId in Stock_Master Table.
can anyone help?


Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Blocked AccountRank #403 · 6.2K reputationPosted Dec 31, 2012, 11:09 PM EST
Try this query to get the output as you want.
SELECT PKStockId,DM.DrugName,TotalQuantityOnHand FROM Stock_Master SM,Drug_Master DM
WHERE SM.FKDrugId = DM.PKDrugId