【发布时间】:2017-08-30 20:07:38
【问题描述】:
收到关于在 REPLACE 语句中使用 IF 语句的查询(如果可能的话!)
例子:
REPLACE("Person Legislative Information"."Marital Status",'Widowed','Widower')
这样行得通,但我需要一个 IF 语句来根据他们的性别区分他们是鳏夫还是寡妇(可以从另一列中提取)。
我会在开始 REPLACE 语句之前放置一个 IF 语句吗?
例子:
REPLACE(REPLACE(IF("Worker"."Gender" = 'M')"Person Legislative Information"."Marital Status",'Widowed','Widower')IF("Worker"."Gender" = 'F')"Person Legislative Information"."Marital Status",'Widowed','Widow')
不确定我是否嵌套了这个错误,但我似乎无法让它工作,有什么想法吗?
【问题讨论】:
标签: sql oracle if-statement replace reporting