如何用同一行中的其他列替换行中的列的值

时间:2019-01-30 17:55:57

标签: oracle

如何用下面同一行中的其他列替换一行中的列的值是示例数据库数据和输出,需要任何帮助。

数据库中的数据:

Data in DB

我尝试使用if else,但下面无法解决的是if else代码示例

if ((@adrln1 is null) and (@adrln2 is not null or @adrln3 is not null or @adrstc is not null or @adrpsz is not null or @ctry_name is not null))
{
    publish data
     where adrnam = @adrnam
       and adrln1 = @adrln2
       and adrln2 = @adrln3
       and adrln3 = @adrstc
       and adrstc = @adrpsz
       and adrpsz = @ctry_name
       and ctry_name = ''
}

必填结果:

Required Result

0 个答案:

没有答案