subquery vs cte1 1

Solutions on MaxInterview for subquery vs cte1 1 by the best coders in the world

showing results for - "subquery vs cte1 1"
Jona
03 Jun 2020
1SELECT 
2  cat_name, 
3  max_pet_date 
4FROM cat_dim
5LEFT JOIN  (
6  SELECT
7  	cat_id, 
8  	MAX(timestamp)::DATE AS max_pet_date,
9    MIN(timestamp)::DATE AS min_pet_date 
10  FROM cat_pet_fact
11  GROUP BY cat_id
12) AS avg_pet_count_over_time
13ON cat_dim.cat_id = avg_pet_count_over_time.cat_id;
14
queries leading to this page
cte vs subquerysubquery vs cte1 1