我有一个名为 medOrder 的表。在这张桌子上,我有订单。一份订单有很多愿望。我试图编写一个查询来显示一条记录和所有愿望的名称,但我认为查询并没有做到最好。
SELECT m.ordcode as koden, w.wish, r.meaName as rnamn, r.meaImg as bild,
r.meaPrice as pris, k.catName as cname from cats k, meals r, wishes w,
meaOrder m
join orders c on c.ordNR='7265'
WHERE m.ordNR=c.ordNR AND m.meaID=r.meaID AND m.wishesID=w.id
AND r.catID=k.catID
ORDER BY m.ordcode DESC;