Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`
Since #26972, `ORDER BY` is kept if `LIMIT` is presented for performance. But in most SQL servers (e.g. PostgreSQL, SQL Server, etc), `ORDER BY` expressions must appear in select list for `SELECT DISTINCT`. We should not replace existing select list in that case.
Showing
想要评论请 注册 或 登录