Jump to content

Archived

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

AV1611

Can't figure out how

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

Share this post


Link to post
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]

 

Share this post


Link to post
Share on other sites

×

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.