AV1611 Posted November 28, 2005 Share Posted November 28, 2005 Table1 fields: JobNumber, Dept, LaborByJobNumber (For EACH Employee charging time to this job) Table2 fields: JobNumber,<--Multiple Listings PartNumber,<--Each run of this PartNumber we build is done under a JobNumber for that PartNumber Qty<-- The TOTAL units built by JobNumber Need to end up with: PartNumber, Dept, Total_Labor_By_Dept, Qty I need to sum() the LaborByJobNumber grouped by Dept AND I need to sum() the QTY grouped by JobNumber HELP!!! Quote Link to comment https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/ Share on other sites More sharing options...
mofm Posted November 28, 2005 Share Posted November 28, 2005 Union the statments together so your sql will look something like this SELECT Name From Users UNION SELECT Name FROM Groups emm u probly wont understand that so go here and it will explain [a href=\"http://www.mysqlfreaks.com/statements/13.php\" target=\"_blank\"]http://www.mysqlfreaks.com/statements/13.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/#findComment-9911 Share on other sites More sharing options...
AV1611 Posted November 28, 2005 Author Share Posted November 28, 2005 Will mysql let you create an intermediary table as part of the query? [!--quoteo(post=322638:date=Nov 27 2005, 11:27 PM:name=mofm)--][div class=\'quotetop\']QUOTE(mofm @ Nov 27 2005, 11:27 PM) 322638[/snapback][/div][div class=\'quotemain\'][!--quotec--] Union the statments together so your sql will look something like this SELECT Name From Users UNION SELECT Name FROM Groups emm u probly wont understand that so go here and it will explain [a href=\"http://www.mysqlfreaks.com/statements/13.php\" target=\"_blank\"]http://www.mysqlfreaks.com/statements/13.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/#findComment-9912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.