MySQL order of query My query return like this.

12
14
14
99
78
78
54


I want result to be sorted so that no same number comes consecutively in the result. The result that I want is like this.

12
14
99
14
78
54
78
Can you please post an example of your query? Without knowing what your query structure look likes, this will be difficult to fix. However here is an example that may point you in the right direction based off of your post title, in regards to ORDER and GROUP:

SELECT pkey,
       COUNT(int),
  FROM my_table
  LEFT JOIN this_table USING (key)
 GROUP BY 1
 ORDER BY 2;