SQL Question

Min and Max in one Group by query

The following query does not run if I include the MAX(col1) in the select clause

SELECT AVG(col1),
MIN(col1),
--ΜΑΧ(col1),
COUNT(*),
col2
FROM view
GROUP BY col2;


how can I rewrite this to get MAX(col1)? using subqueries?

Answer

You are having unicode trouble:

ΜΑΧ(col1) -- will not execute
MAX(col1) -- will execute

The first one consists of GREEK CAPITAL LETTERs,

Μ is a GREEK CAPITAL LETTER MU (see this) etc.