I have two Postgres queries that work.
SELECT date_trunc('hour', time) t, COUNT(*) AS "SC15" FROM logfile
WHERE source = 'SC15' AND type = 'Sort'
GROUP BY t ORDER BY t;
SELECT date_trunc('hour', time) t, COUNT(*) AS "SC71" FROM logfile
WHERE source = 'SC71' AND type = 'Sort'
GROUP BY t ORDER BY t;
How can I get the results to display side-by-side in separate columns? A t (interval) column, an SC15 column, and an SC17 column grouped by hour. I have tried UNION and INTERSECT. I think I need to make a temp table? Not sure how. Thanks!