How to reuse calculated columns avoiding duplicating the sql statement?

后端 未结 6 1348
忘掉有多难
忘掉有多难 2020-12-09 07:51

I have a lots of calculated columns and they keep repeting themselves, one inside of the others, including nested cases statements.

There is a really simplified ver

6条回答
  •  北海茫月
    2020-12-09 08:45

    You can create computed columns to represent the values you want. Also, you can use a view if your calculations are dependent on data in a separate table.

提交回复
热议问题