Jump to content

Can't figure out how


AV1611

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.