View Single Post
Old 08-15-2019, 03:11 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,342
Thanks: 67
Thanked 2,678 Times in 2,564 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Combining multiple sub-records against each row in a report

you can have 1 faults table instead of 5.
just add one column and input the 1,2 3,4 or 5.

any way, what does 24 means in Fault1 24? is it the count?
Code:
select T2.product.piece_id,  
(select count("1") from fault1Table As T1 where T1.piece_id=T2.piece_id) As Fault1, 
(select count("1") from fault2Table As T2 where T1.piece_id=T2.piece_id) As Fault2, 
...
...
From productTable As T2;

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote