I am creating an application using Wavemaker with MySQL backend
I am trying to create a HQL where there are no FK's present between tables
Relationship as follows
OrderHeader join OrderDetail on headerID OrderDetail join ItemMaster on itemID
I can get the first part of the query working, but not sure how to add the third part - How would i join the ItemMaster from here? The OrderDetail table has a itemID field, but I want to join the ItemMaster table to get the itemDescription (red items are fields I want add/join)
When I add the red items, I get errrors
select order.poID as PO, detail.lineID as line, detail.vskuID as itemID, items.ItemDescription
from OrderDetail as detail
LEFT JOIN OrderHeader as order where order.headID=detail.headID JOIN ItemMaster as items where detail.itemID=items.itemID
ORDER BY order.poID,detail.lineID
|