Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
406 B
1
Indexable
Never
CREATE DEFINER=`root`@`localhost` PROCEDURE `DisplayBillProducts`(
  IN billId INT
)
BEGIN
  SELECT
    cod.SKU,
    t.Name,
    cod.Quantity,
    cod.Price
  FROM
    CustomerOrderDetail cod
    INNER JOIN CustomerOrder co ON cod.CustomerOrderId = co.CustomerOrderId
    INNER JOIN Bill b ON co.CustomerOrderId = b.CustomerOrderId
    INNER JOIN Toy t ON cod.SKU = t.SKU
  WHERE
    b.BillId = billId;
END