Relative Content

Tag Archive for postgresqlcommon-table-expression

POSTGRES CTE value not being used in WHERE clause

I’m trying to run this query that updates an ordering column after inserting the rows, and everything seems to work fine except using the id FROM the CTE query in the WHERE clause doesn’t work, even though it works everywhere else. This is the query