I have a table called service entry and Im trying to create a concatenated string.
ID ServiceEntryID PartID Comment ServiceTypeIDs PartDescription
1 2 54 xyz 1 hellothere
2 2 22 howdy
3 33 54 uhu 1 xyz
Desired String format
PartID~PartDescription~ServiceTypeIDs~Comment
Desired String value
so for service entry ID column with value 2:
54 ~ hellothere ~ 1 ~ xyz | 22 ~ howdy ~ null ~ |
for service entry ID column with value 33:
33 ~ xyz ~ 1 ~ uhu
If the entry does not have a comment then I do not add a null for it whereas if servicetypeids are empty then I will add a null