Best way to do nested case statement logic in SQL Server

前端 未结 9 1360
误落风尘
误落风尘 2020-11-29 15:23

I\'m writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions.

I\'m currently using nested case stateme

9条回答
  •  無奈伤痛
    2020-11-29 16:02

    a user-defined function may server better, at least to hide the logic - esp. if you need to do this in more than one query

提交回复
热议问题