Postgresql – Group records by selected values into different columns
I have following example: create table products (name text, id integer, type smallint, category integer); insert into products values ('apple', 23, 1, 1200), ('apple', 23, 1, 999), ('apple', 31, 2, 1200), ('apple', 23, 3, 1200), ('orange', 10, 1, 200), ('orange',…