DISTINCTROW appears in the SELECT clause to filter out duplicate rows. Its behavior depends on the database engine:• MySQL and MariaDB – DISTINCTROW is parsed as an alias for DISTINCT. The engine compares all selected columns and returns one copy of each unique combination. Using DISTINCTROW instead of DISTINCT has no functional or performance benefit.• Microsoft Access – DISTINCTROW removes duplicate records based on the entire underlying row, not just the columns listed in the SELECT list. It is mostly useful in join queries where multiple child records would otherwise generate duplicates for the parent table’s rows. Access keeps one instance of each parent row even if children differ.DISTINCTROW is not part of ANSI/ISO SQL and is unrecognized by PostgreSQL, SQL Server, Oracle, SQLite, Snowflake, BigQuery, and most other systems. Attempting to use it in those dialects raises a syntax error.Because DISTINCTROW is proprietary and occasionally misunderstood, most practitioners prefer DISTINCT unless they are writing Access-specific queries that need parent-row de-duplication.
SELECT, DISTINCT, ALL, GROUP BY, UNIQUE indexes
MySQL 3.23 and Microsoft Access 2.0
In MySQL never - DISTINCTROW is an alias for DISTINCT. In Microsoft Access use it in join queries when you want each parent row only once, regardless of how many matching child rows exist.
No. PostgreSQL, like most standards-compliant databases, only recognizes DISTINCT. Using DISTINCTROW there leads to a syntax error.
No. The MySQL optimizer treats both keywords identically, so there is no performance difference.
No. DISTINCTROW is a proprietary extension found only in MySQL, MariaDB, and Microsoft Access.