我試圖做一個表中的多個選擇,但它只顯示最後一個選擇語句。在存儲過程中的多重選擇
CREATE PROCEDURE `usp_GetStockCard` (IN Matecode varchar(10))
BEGIN
(select tran_date as tran_date
from TM_matbalance
where Mate_code=Matecode);
(select Mate_code as Mate_code
from TM_matbalance
where Mate_code=Matecode);
(select tran_qtyx as Qty_in
from TM_matbalance
where tran_type='IN'
and mate_code=matecode);
(select tran_qtyx as Qty_out
from TM_matbalance
where tran_type='OUT'
and mate_code=matecode);
END
我試圖在每個select語句後將分號更改爲逗號,但它表示語法錯誤:缺少'分號'。 請幫忙。
您能否提供一些數據和期望的輸出? –
這裏有一些數據和所需的輸出: [鏈接](http://tinypic.com/r/2zxs8qe/8) – Syns