I have a Query, in Trino Enginee, that I am creating several CTEs but I am losing the ORDER BY logic when I add the CTEs
Its like this:
WITH AS CTE1(...)
CTE2 AS (.....ORDER BY 2)
CTE3 AS(...)
CTE4 AS(...)
FINAL SELECT * FROM CTE4
I want to know how to make the final result have the same ordering as the first ORDER BY
I’m using the Trino engine, I don’t have much knowledge about it, I need help
New contributor
Thiago Melo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.