これが私の質問です:
SELECT
O.OrderId,
O.Number,
(SELECT
CONCAT(A.Detail, ' ', C.Name, ' / ', Ci.Name)
FROM
kobiakinlar.Address AS A
INNER JOIN
County AS C ON C.CountyId = A.CountyId
INNER JOIN
City AS Ci ON C.CityId = Ci.CityId
WHERE
UserId = O.UserId) AS UserAddress,
(SELECT
CASE
WHEN O.Status = 0 THEN 'Onay Bekliyor'
WHEN O.Status = 1 THEN 'Onaylandı'
WHEN O.Status = 2 THEN 'Reddedildi'
END
) Status,
O.Creation,
(SELECT
CASE
WHEN O.IsDelivered = 0 THEN 'Teslim Edilmedi'
ELSE 'Teslim Edildi'
END
) IsDelivered,
SUM(T.Price) Price,
GROUP_CONCAT(T.NAME) Products
FROM
kobiakinlar.order O
INNER JOIN
(SELECT
P.Name, op.OrderId, op.Price
FROM
kobiakinlar.product P
JOIN kobiakinlar.orderproduct op ON op.ProductId = P.productId
) T ON O.orderId = T.orderId
INNER JOIN
address A ON A.AddressId = O.AddressId
それは戻ります:
しかし、私はこれを試してみたいです:
私は何をすべきか?何か提案はありますか?