Jeffrey Ratcliffe
<[EMAIL PROTECTED]> wrote:
SELECT eid, P, subcase
FROM temp a1
WHERE NOT EXISTS (
SELECT *
FROM temp a2
WHERE a2.eid == a1.eid AND a2.P < a1.P
)
ORDER BY eid
GROUP BY eid;
I get a syntax error, complaining about GROUP. If I switch the ORDER
and GROUP lines, I get the desired result - thanks. What is wrong with
the first version?
The fact that GROUP BY follows ORDER BY, of course. You are probably not
surprised that you can't, say, put WHERE clause in front of FROM clause
or SELECT clause - why are you surprised that other clauses must also be
used in a certain order?
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------