79699876

Date: 2025-07-13 10:11:14
Score: 2.5
Natty:
Report link
with first_cte as (
  select * 
  from a_table 
  where 1=1
),
second_cte as (
    select 
    column_1,
    column_2,
    column_3
  from b_table b
    inner join first_cte f on f.user_id = b.user_id
    where 1=1)
select * from second_cte 

In theory you could do something like this. Although it is not direclty possible now to execute the inner block of second_cte in dataGrip because you will have the same problem of first_cte not being known, there is a plugin you could use for that, i discovered when i had this problem.
https://plugins.jetbrains.com/plugin/27835-ctexecutor

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have the same problem
  • Low reputation (1):
Posted by: idy