Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

How to get results from multple queries into one table in MySQL stored procedure

$
0
0

I have the queries below in one stored procedure and want to put the results of those queries into one tmp table. How do I do that?

        CREATE DEFINER=`server`@`%` PROCEDURE `GetMonthlyRate`()
         BEGIN

        SELECT OH.ActualWeight, OH.ServiceDate
        FROM OperationsHaul OH                        
        WHERE OH.RecordDisabled = 0 AND
        CCT.CoreContentTypeCategoryID = 1;




        SELECT OH.ActualWeight, OH.IsRecycleContaminated, 
        OH.RecycleContaminationPercent, OH.RecycleRebatePercent, 
        OH.CoreContentTypeID, OH.ServiceDate
        FROM OperationsHaul OH  
        WHERE OH.RecordDisabled = 0 AND
        CCT.CoreContentTypeCategoryID = 1;



        SELECT OH.ActualWeight, OH.IsRecycleContaminated, 
        OH.RecycleContaminationPercent,
        FROM OperationsHaul OH  
        WHERE OH.RecordDisabled = 1 AND
        CCT.CoreContentTypeCategoryID = 1;

       END

Is it a CREATE TABLE or INSERT??


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>