Hi,
I have a sql query as follows:
Declare @DivisionNo INT
SET @DivisionNo = 5117
SELECT distinct CASE WHEN ISNULL([DivisionNo],'') < @DivisionNo THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo
--,[RecordID]
,[AcctCat]
,[AcctCatDesc]
,[CostCode]
,[CostCodeDesc]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE DivisionNo = @DivisionNo
UNION
SELECT distinct CASE WHEN ISNULL([DivisionNo],'') < @DivisionNo THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo
--,[RecordID]
,[AcctCat]
,[AcctCatDesc]
,[CostCode]
,[CostCodeDesc]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE AcctCat not in (
SELECT [AcctCat]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE DivisionNo = @DivisionNo)
How can I duplicate it using linq to sql?
Thanks