Skip to content
Advertisement

Postgresql merge columns

I have a main table which is like this

I can merge full_name and last_name like this

but I couldn’t do the same thing with the children_names column I want to select children like this

but I want to add last_name filed at the end of each child like this

Advertisement

Answer

Using a scalar subquery:

Yet it would be much better to structure your data as @BarbarosÖzhan suggests.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement