Enter and search for new-line character in JSONB column in PostgreSQL

select distinct on (column1) column1, column2
from sample_table

-or-

select column1, max(column2)
from sample_table
group by column1

These examples return one of the values aggregated in column2. While the first example will return the first that it finds, the second will return the maximum value, which is one of the values.

References: