Stacie
asked on
Inner Join, SQL Function
Could someone explain me these line of code especially with the inner join and the select statement. Is this f31122.wtan8 a reference to another table? It will be greatly appreciated. Thank you.
Declare @WORouting Table
( WONbr float,
OpCode float,
OpCodeDesc nvarchar(100),
EstHours float,
ActHours float,
EmpNbr float,
EmpName nvarchar(100),
WAITM float
)
Insert @WORouting
(WONbr,
OpCode ,
OpCodeDesc ,
EstHours ,
ActHours,
EmpNbr ,
EmpName ,
WAITM
)
Select wo.WONbr,
f3003.IROPSQ / 100,
f3003.IRDSC1,
f3003.IRRUNL,
sum(f31122.wthrw / 100),
f31122.wtan8,
'',
f3003.IRKIT
from @WorkOrders wo
inner join ps_prod.proddta.f3003 f3003 (nolock)
on wo.waitm = f3003.irkit
and ltrim(rtrim(f3003.IRMMCU)) = '308'
inner join ps_prod.proddta.f31122 f31122 (nolock)
on f3003.irkit = f31122.wtkit
and f3003.iropsq = f31122.wtopsq
group by wo.WONbr,
f3003.IROPSQ / 100,
f3003.IRDSC1,
f3003.IRRUNL,
f31122.wtan8,
f3003.IRKIT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
from @WorkOrders wo
inner join ps_prod.proddta.f3003 f3003 (nolock)
on wo.waitm = f3003.irkit
and ltrim(rtrim(f3003.IRMMCU))
inner join ps_prod.proddta.f31122 f31122 (nolock)
on f3003.irkit = f31122.wtkit
and f3003.iropsq = f31122.wtopsq