由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Efficiency difference?
相关主题
How to find a duplicate record in Access?DBA主要是做优化还是维护
问个import large amount data的问题Dataware的Decision Support Analyst有前途吗? 多谢建议!
How to design a database model related to six degree of separation?高手请指点: How to query specific data in all columns efficiently
deletecan .pc and .c make difference?
吐血了what is PL/SQL ?
职业杯上一个DATABASE题目。 (转载)what's difference between MIS and CS?
JDBCdatabase study help
讨论一下经验积累型,能防老的工种吧! 急问: 请问SQL适合做这种计算吗?
相关话题的讨论汇总
话题: efficiency话题: difference话题: when话题: case话题: idea
进入Database版参与讨论
1 (共1页)
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.

1 (共1页)
进入Database版参与讨论
相关主题
急问: 请问SQL适合做这种计算吗?吐血了
面试回来发考题1职业杯上一个DATABASE题目。 (转载)
what is the difference between merge and update (oracle interview question)JDBC
这个sql语句怎么写讨论一下经验积累型,能防老的工种吧!
How to find a duplicate record in Access?DBA主要是做优化还是维护
问个import large amount data的问题Dataware的Decision Support Analyst有前途吗? 多谢建议!
How to design a database model related to six degree of separation?高手请指点: How to query specific data in all columns efficiently
deletecan .pc and .c make difference?
相关话题的讨论汇总
话题: efficiency话题: difference话题: when话题: case话题: idea