Good day! In the table, among others, there is a field "rank" (int). And it is necessary in GROUP BY to derive the difference between the first "rank" in the table and the last. That is, not between MAX and MIN, namely, between the first entry and the last one. How to do it? Thank.
http://sqlfiddle.com/#!9/373abe
PS The imposed link to a possible "duplicate" question does not contain the MySQL query operator I need.