On Wed, Feb 25, 2026 at 9:00 AM Adrian Klaver <[email protected]>
wrote:

> 1) Why FROM (SELECT * FROM t1 ) AS t1 instead of just FROM t1?
>     Same for JOIN (SELECT * FROM t3   ) t3
>

Seems immaterial.  It's just a consequence of simplifying the original
problem query. If it is consequential that would seem buggy.


> 2) Why are the field names not table qualified e.g. t2.id, t3.id, etc?
>

Because of the USING clause, those references shouldn't exist in the main
query.


> 3) What is the desired outcome?
>

For the engine to realize the 'id' in the group by and the 'id' in the
scalar subquery are the same 'id' - the one produced by the USING clause,
not either of the t2 or t3 ids.

My first impression is that this is a bug.  Especially since the query
apparently executes in both left-join and right-join modes.

David J.

Reply via email to