I want to create a new column called NewHeight that takes the single value found in the Height column and replicates it for all the same Name. This is the query I am using.
Select
Name,
Height,
case when Height is not null then max(Height) over(partition by Name) end as NewHeight
from MyTable
This is my output:
Name Height NewHeight
Johny
Johny 5.6 5.6
Johny
Mike
Mike
Mike 6.1 6.1
This is desired output :
Name Height NewHeight
Johny 5.6
Johny 5.6 5.6
Johny 5.6
Mike 6.1
Mike 6.1
Mike 6.1 6.1