MySQL Forums
Forum List  »  General

not giving accurate result in left join condition
Posted by: strange world
Date: March 23, 2016 02:38AM

Hi,

i have this query but this is not getting the accurate result.

select
st.ST_TRANS_CODE , stdt.INV_ITEM_DETAIL FROM
store_trans st
inner join store_trans_det stdt on st.OID = stdt.STORE_TRANS
inner join item_detail id on stdt.ITEM_DETAIL = id.OID
inner join Category cat on cat.OID = id.category
left join assignmentdetail ad on ( ad.STORE_TRANS = stdt.STORE_TRANS
and ad.ITEM_DETAIL = stdt.ITEM_DETAIL
and ad.isAssigned = 0)
where st.sTORE = 10;



the left join condition as ad.isAssigned = 0 is not working correctly.
what i want that if store_trans_det have some records but assignmentdetail table doesn't have all that ones but a few. so it should show all records presented in store_trans_det and those who have ad.isAssigned = 0 in assignmentdetail table.

can anybody guide ?

thanks

Options: ReplyQuote


Subject
Written By
Posted
not giving accurate result in left join condition
March 23, 2016 02:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.