There's few ways to achieve that.
I'd like to provide a sample with Common Table Expressions:
;WITH CTE AS
(
SELECT 1 Lvl, acctnum, note, srno, note newnote
FROM Table1
WHERE acctnum IS NOT NULL
UNION ALL
SELECT C.Lvl +1, C.acctnum, T.note, T.srno, CONCAT(C.newnote, ' ', T.note) newnote
FROM CTE C
INNER JOIN Table1 T
ON (T.srno - C.srno = 1)
AND T.acctnum IS NULL
),
FINAL AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY acctnum ORDER BY Lvl DESC) RN
FROM CTE
)
SELECT acctnum, newnote note
FROM FINAL
WHERE RN =1
SQL Server 2022 | db<>fiddle[
^]
Result:
acctnum note
12 abc efd xyz
15 pqr
16 uio njk uuuwr kmjkj
18 zzzzzzz