Yeah, I always considered that quite strange, given the order of the query (and even though forward references are found almost everywhere in SQL, making it even more strange)
ORM-wise it's not a huge issue, I tend to move them outside the query definition to avoid the duplication. E.g.
ORM-wise it's not a huge issue, I tend to move them outside the query definition to avoid the duplication. E.g.