I have this SQL query i want to convert to LINQ. The multiple or conditions in the join clause is causing problem.
SELECT tbl1.SUB_PART_1, tbl1.ID, tbl1.VAR_VALUE ,tbl1.DETAILS
FROM dbo.tbl_IDS tbl1
JOIN (SELECT tbl2.PART_1, tbl2.PART_2, tbl2.PART_3, tbl2.PART_4,
tbl2.PART_5, tbl2.PART_6, tbl2.PART_7, tbl2.PART_8, tbl2.PART_9,
tbl2.PART_10, tbl2.PART_11, tbl2.PART_12, tbl2.PART_13,
tbl2.PART_14,tbl2.PART_15,tbl2.PART_16,tbl2.PART_17,tbl2.PART_18,
tbl2.PART_19,tbl2.PART_20
FROM dbo.tbl2_Mapping tbl2
WHERE tbl2.VAR_NUMBER = "Number") AS tbl_TEMP
ON
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_1 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_2 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_3 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_4 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_5 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_6 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_7 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_8 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_9 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_10 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_11 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_12 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_13 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_14 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_15 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_16 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_17 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_18 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_19 OR
tbl1.SUB_PART_1 + '.' + tbl1.SUB_PART_2 = tbl_TEMP.PART_20) WHERE
tbl1.STATUS = 8";
How to write linq queries when join clause has multiple conditions.
