0
我寫過一個存儲過程。 shipmentnumbers和cartonid都應返回逗號分隔值。出貨編號即將到來,即逗號分隔值,但cartonid總是隻返回一個值,即使有多行。我如何解決這個問題。存儲過程中無法識別的GROUP_CONCAT值
DELIMITER $$
CREATE PROCEDURE `sp_deleteOrderData`(orderid BIGINT(11))
BEGIN
DECLARE shipmentnumbers VARCHAR(1000);
DECLARE cartonid VARCHAR(1000);
SELECT GROUP_CONCAT(a_shipmentid) FROM t_shipment WHERE a_orderid = orderid INTO shipmentnumbers;
SELECT GROUP_CONCAT(a_cartonid) FROM t_carton WHERE a_shipmentid IN (shipmentnumbers) INTO cartonid;
SELECT shipmentnumbers;
/*SELECT cartonid; */
END$$
DELIMITER ;