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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Blocked AccountPosted Jan 1, 2013, 4:09 AM
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