SELECT
MenuName,
Ingredients,
(
SELECT `Comment`
FROM `MenuComments`
WHERE `id`=MenuBindings.CommentId
)
AS Comments,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.SmallPriceId
)
AS SmallPrice,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.MediumPriceId
)
AS MediumPrice,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.LargePriceId
)
AS LargePrice
FROM `Menus`
JOIN MenuBindings
ON Menus.id=MenuBindings.MenuId
WHERE MenuBindings.CompanyId=10
AND MenuBindings.SubmenuId=12
Sugesties?
Alvast bedankt
MenuName,
Ingredients,
(
SELECT `Comment`
FROM `MenuComments`
WHERE `id`=MenuBindings.CommentId
)
AS Comments,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.SmallPriceId
)
AS SmallPrice,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.MediumPriceId
)
AS MediumPrice,
(
SELECT FORMAT(`value`, 2)
FROM `Prices`
WHERE `id`=MenuBindings.LargePriceId
)
AS LargePrice
FROM `Menus`
JOIN MenuBindings
ON Menus.id=MenuBindings.MenuId
WHERE MenuBindings.CompanyId=10
AND MenuBindings.SubmenuId=12
Sugesties?
Alvast bedankt