T-SQL Case Statement in a JOIN ON Clause

后端 未结 6 2000
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 15:09

I am trying to build a case/if statement in a JOIN ON clause.

LEFT JOIN [CTSTRC] [Statuses] ON RIGHT([Statuses].[STRID], 3) = [CTE].[F61]
         


        
6条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 15:44

    You might want to try something like this

    select ...
    from CTE
    inner join
    (
        select ...
        from [Statuses]
        where ISNUMERIC(STRID + '.0e0') = 1
    ) rsNumeric on CTE.F61 = rsNumeric.STRID
    

提交回复
热议问题