Как заменить значение столбца в строке другими столбцами в той же строке ниже, это пример данных в дБ и вывод, который требуется, любая помощь будет приветствоваться.
Данные в БД:

Я пытался использовать если иное, но не смог решить, ниже приведен пример, если еще код
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 = ''
}
Обязательный результат:
