On Tue, May 30, 2023 at 05:53:30PM +0200, Marc Millas wrote: > Thanks Adrian, but if the query becomes more complex, for example with a > few joins more, then even casting doesn't work. > This comes from a prod environment and even casting NULLs (which is more > than strange, BTW) generates absurd errors. > Too my understanding it looks like the parser did not parse the select > distinct as we think he does.
Show *real* example that doesn't work, with schema. Clearly your example can be easily made to work. Best regards, depesz