[Solved] SELECT * FROM people WHERE user_id=’$user_id’ ORDER BY time GROUP BY surname [closed]


The ORDER BY clause should be the last, but you have to specify fields to be aggregated.

Such as:

SELECT surname, count(*) 
    FROM people 
    WHERE user_token='$user_token'
    GROUP BY surname
    ORDER BY surname

1

solved SELECT * FROM people WHERE user_id=’$user_id’ ORDER BY time GROUP BY surname [closed]