query in 1-many relationship

C

cz

In our db we have a table for tracking manufacturing
conditions.
tblProcessing
BatchID
RunDate
MaterialType
EquipID
Etc.
When the batch is made it is placed in 1-5 container(s).
They now want to capture this container information: Type,
Size, and Amount per container. Since it can be more than
1 container, I figure I need a separate tblContainer with
BatchID as a foreign key to tblProcessing. When it comes
to running queries, what's the best way to merge the 2
tables together so that for example, where
MaterialType=XYZ, output * from tblProcessing and merge it
with tblContainer.* so that I only have one line record
for each BatchID. Loop through tblContainer and....
I think my users would be fine with the output:
BatchId JI8903 JH3490
RunDate 1/1/03 1/2/03
MaterialType XYZ XYZ
EquipID Prod9 Prod5
Container1Type Quartz Alum
Container1Size 3x5x7 Large
AmtContainer1 5 10
Container2Type Quartz
Container2Size 3x5x7
AmtContainer2 5
Etc.
Please bear in mind that my SQL skills are very limited.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top