I\'m trying to do multiple selects from different tables in a mysql stored procedure as follows
DELIMITER //
CREATE PROCEDURE `NovemberSummary`(IN `branch` VA
Using Multiple Select Statement in Stored Procedures
Try with the below query.
select distinct ProdSubCategory, NULL,NULL
from Table1
inner join Table2 on ID_FK= ID_PK
where Table2.Type=@chvType and Table1.ProdCategory=@chvProdSubCategory
UNION ALL
select NULL, Brand,NULL
from Table1
inner join Table2 on ID_FK= ID_PK
where Table2.Type=@chvType and Table1.ProdCategory=@chvProdSubCategory
UNION ALL
select NULL, Price,NULL
from Table1
inner join Table2 on ID_FK= ID_PK
where Table2.Type=@chvType and Table1.ProdCategory=@chvProdSubCategor