I am trying to exceute a query in xata.sql but it thorws an error where I try to use a CTE.
CTE as a general works but whe, for example if I try to use select * for ProductMaxDiscount ; it is working. But if I use an alias for the cte and refer them in select or try to join with other, I get table not found error.
I tried the query in other postgres env, it is working fine. Below is the query I want to execute. And below that I'll attach the ddl for quick start for testing.
```