Postgresql – Combine two tables with multiple granularity level
I have two tables and I want to merge them. Fiddle here: http://sqlfiddle.com/#!17/999d0 Result table is what I expect to get. Table utm is a source-main table and table report contains data for utm rows. What I need: Take id…