clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1228855 fiddles created (16653 in the last week).

CREATE TABLE problems ( name text ); INSERT INTO problems VALUES (E'My\nproblems are\nnot really\nbad'), (E'I hate people'), (E'I like\npeople'), (E'I\nam\nhere.'), (E'I\nam there\n'); SELECT * FROM problems;
5 rows affected
name
My problems are not really bad
I hate people
I like people
I am here.
I am there
 hidden batch(es)


SELECT name, array_remove((array_agg(sum))::int[], length(name) + 1) FROM ( SELECT name, SUM(length(lines) + 1) OVER (PARTITION BY name ORDER BY row_number) FROM ( SELECT *, row_number() OVER () FROM ( SELECT name, regexp_split_to_table(name, '\n') as lines FROM problems )s )s ) s GROUP BY name
name array_remove
I am here. {2,5}
I am there {2,11}
I hate people {}
I like people {7}
My problems are not really bad {3,16,27}
 hidden batch(es)