select *
from servrectrans
where servrectrans.refwo ='W3298301'
Query returns 2 records
select *
from wpservice
where wpservice.wonum ='W3298301'
Query returns only one record
Now when I run the below query, I am getting 2 rows returned
SELECT
wpservice.plusplineprice as PlanServicePrice,
wpservice.linecost as PlanServiceCost,
servrectrans.plusplineprice as ActualServicePrice,
servrectrans.linecost as ActualServiceCost
FROM
((workorder
inner join wpservice WITH (NOLOCK) on wpservice.wonum = workorder.wonum )
inner join servrectrans WITH (NOLOCK) on servrectrans.refwo = workorder.wonum)
where WORKORDER.WONUM = 'W3298301';
I think the second entries for PlanServicePrice and PLanServiceCost are incorrect? They should NULL. Could this be fixed using a different type of join?
Thanks in advance.