dimanche 26 juin 2016

mysql group by and order by id breaks

I have a table with columns id, q_id, Question, Answer, Q_Date

I have made a query which concatenates multiple rows having same q_id.

Here is the query:

select q_id, Question, Link, Q_Date,
    GROUP_CONCAT(Answer SEPARATOR 'n') as Answer
    from ask
group by q_id, Question, Link, Q_Date

What I want to do is order by the id column, but when I select id column, it shows all the rows, UnConcatenated.

please help

Aucun commentaire:

Enregistrer un commentaire