Question : SQL Nested Left Join -- Legal Usage?

Hello EE,
I'm working with a Item/Component table that has nested levels of data within its three columns.  the query below is delivering results, but I've never created a left join on a table that's already a left join.  Is this left join usage legal?

Thanks,
LVBarnes
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Select	pc.ParentItem, pc.ComponentItem as 'Component1',  pc.QtyPer as 'QtyPer1'
					, pc1.ComponentItem as 'Component2', pc1.QtyPer as 'QtyPer2'
					, pc2.ComponentItem as 'Component3', pc2.QtyPer as 'QtyPer3'
					, pc3.ComponentItem as 'Component4', pc3.QtyPer as 'QtyPer4'
					, pc4.ComponentItem as 'Component5', pc4.QtyPer as 'QtyPer5'
From ParentChild pc
Left Join ParentChild pc1 on pc.ComponentItem = pc1.ParentItem
Left Join ParentChild pc2 on pc1.ComponentItem = pc2.ParentItem
Left Join ParentChild pc3 on pc2.ComponentItem = pc3.ParentItem
Left Join ParentChild pc4 on pc3.ComponentItem = pc4.ParentItem
WHERE pc.ParentItem = '2010STD8FT-17'
Order by pc.ParentItem
	, pc.ComponentItem
	, pc1.ComponentItem
	, pc2.ComponentItem
	, pc3.ComponentItem
	, pc4.ComponentItem
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Select	pc.ParentItem, pc.ComponentItem as 'Component1',  pc.QtyPer as 'QtyPer1'
	, pc1.ComponentItem as 'Component2', pc1.QtyPer as 'QtyPer2'
	, pc2.ComponentItem as 'Component3', pc2.QtyPer as 'QtyPer3'
	, pc3.ComponentItem as 'Component4', pc3.QtyPer as 'QtyPer4'
	, pc4.ComponentItem as 'Component5', pc4.QtyPer as 'QtyPer5'
From ParentChild pc
Left Join ParentChild pc1 on pc.ComponentItem = pc1.ParentItem
Left Join ParentChild pc2 on pc1.ComponentItem = pc2.ParentItem
Left Join ParentChild pc3 on pc2.ComponentItem = pc3.ParentItem
Left Join ParentChild pc4 on pc3.ComponentItem = pc4.ParentItem
WHERE pc.ParentItem = '2010STD8FT-17'
Order by pc.ParentItem
	, pc.ComponentItem
	, pc1.ComponentItem
	, pc2.ComponentItem
	, pc3.ComponentItem
	, pc4.ComponentItem

Answer : SQL Nested Left Join -- Legal Usage?

You need to limit your LUN size to just under 2TB (2TB - 512 bytes to be precise). You may want to recreate your array to be within that limit.

Good Luck
Random Solutions  
 
programming4us programming4us