s******r 发帖数: 1524 | 1 Reading some code from other team.
He wrote code in such a way,
case when a='1' then 'N'
when a='2' then 'N'
.....
instead of case when a in ('1','2',....)
No idea whether there is some difference between operation time. Anyone has
idea? Thanks. | B*****g 发帖数: 34098 | 2 I guess same, hehe.
Better use ****case a when '1' Then 'N' when '2' Then 'N' .... **** if you can
has
【在 s******r 的大作中提到】 : Reading some code from other team. : He wrote code in such a way, : case when a='1' then 'N' : when a='2' then 'N' : ..... : instead of case when a in ('1','2',....) : No idea whether there is some difference between operation time. Anyone has : idea? Thanks.
| s******r 发帖数: 1524 | 3 Thanks. Really good to know that.
you can
【在 B*****g 的大作中提到】 : I guess same, hehe. : Better use ****case a when '1' Then 'N' when '2' Then 'N' .... **** if you can : : has
| j*****n 发帖数: 1781 | 4 他这么做会比较方便以后的修改。
比如说,需求变了, 当 2 的时候得是 'P'...
他改的时候就很方便。
而且这样的code 读起来要容易。
has
【在 s******r 的大作中提到】 : Reading some code from other team. : He wrote code in such a way, : case when a='1' then 'N' : when a='2' then 'N' : ..... : instead of case when a in ('1','2',....) : No idea whether there is some difference between operation time. Anyone has : idea? Thanks.
|
|