I am using xml to display the query result. I have one issue related to my query. Say in the customer table i have an data whose id is not a forigne key in any of the other tables, but still I want to display the data. i a, using left join for this. But the problem is with the other table conditions( Where clause pr.fActive=1…) due to which the i am not able to display the data which is only there in customer table but not in other table. How it can be done
<Table>customer cu</Table>
<Joins>
left join customerprogramxref cuprxref on cu.ixcustomer=cuprxref.ixcustomer
left join tblprogram pr on cuprxref.ixprogram=pr.ixprogram
left join programworkpackagexref prwpxref on pr.ixprogram= prwpxref.ixprogram
left join workpackage wp on wp.ixworkpackage =prwpxref.ixworkpackage
left join workpackageactivityxref wpactxref on wpactxref.ixworkpackage=wp.ixworkpackage
left join activity act on act.ixactivity=wpactxref.ixactivity
</Joins>
<WhereClause>
cu.fStatus=1 AND pr.fActive=1 AND pr.fDeleted=0 AND wp.fStatus=1 AND act.fStatus=1
</WhereClause>
Because of
LEFT JOIN, in the right part you have NULL when not joined.Try this: