LEFT OUTER JOIN leaves rows
-
I have to tables 1: Main table 2: Text table the relation is one to many. If there isent any matches in the text-table i want the post from the main-table My query: (Swedish columname“s) ------------------------------------ SELECT arrProdKat.prod,arrProdKat.lev,arrProdKatText.sprak, rubrik =CASE WHEN(arrProdKatText.sprak is null) THEN arrProdKat.rubrik ELSE arrProdKatText.rubrik END, info =CASE WHEN(arrProdKatText.sprak is null) THEN arrProdKat.info ELSE arrProdKatText.info END FROM arrProdKat LEFT OUTER JOIN arrProdKatText ON arrProdKat.arr=arrProdKatText.arr AND arrProdKat.lev=arrProdKatText.lev AND arrProdKat.prod=arrProdKatText.prod AND arrProdKat.arrKat=arrProdKatText.arrKat WHERE arrProdKat.arr=@arr AND arrProdKat.arrKat=@arrKat AND(arrProdKatText.sprak=@sprak OR arrProdKatText.sprak is null) ------------------------------------------- The result dont find the post in the main-table if ther are child-posts in the text-table, even if they dont equals @sprak.