Jump to content

Recommended Posts

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!!!

Link to comment
https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/
Share on other sites

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]

Link to comment
https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/#findComment-9911
Share on other sites

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]

 

Link to comment
https://forums.phpfreaks.com/topic/2946-cant-figure-out-how/#findComment-9912
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.