VERIFIED SOLUTION i

MapInfo Pro error: "Column references in Order By clause must be in the query expression list when used with a Group By clause"

Product Affected: MapInfo Pro™

Issue

User is trying to run a SQL query in MapInfo Pro, using "Group By" and "Order By" variables and with a conditional in the "Where" condition and gets an error message:

"Column references in Order By clause must be in the query expression list when used with a Group By clause"

User-added image

Cause

In this example, the user listed 2 variables in the "Order by" section and one variable at the "Group by" section (and a conditional at the "Where" condition) but at the "Select Columns" section, did not list all of those variables listed in the "Order By" section.
All variables listed at the Order By section of the SQL Query Dialog must also be listed at the Select Columns section.

 

Resolution

UPDATED: August 7, 2019
To resolve this issue, make sure all variables listed in the "Order by Columns" are also listed at "Select Columns":

User-added image