skip to Main Content

Postgresql – How to generate this summary from my tables

I have the following two tables: CREATE TABLE segments(session_id INT, segment_id INT, length DOUBLE PRECISION, movement BOOLEAN); INSERT INTO segments (session_id, segment_id, length, movement) VALUES (49,0,0,'f'),(49,1,180851,'t'),(49,2,1.31082,'f'),(49,3,1580.41,'t'), (49,4,1.0059,'f'),(49,5,4.47451,'t'),(49,6,1.69973,'f'),(55,0,2.76848,'f'), (55,1,2.60235,'t'),(55,2,3.807,'f'),(55,3,2.78887,'t'),(55,4,8.47029,'f'); CREATE TABLE trips (trip_id INT, session_ids INT[], distance DOUBLE PRECISION); INSERT INTO…

VIEW QUESTION
Back To Top
Search