Doubt in SQL Query

1

Personal I have the following table:

--- mensagens
id
usuario_envia
usuario_recebe
texto
data_envio

But I want to list only the "Conversations", for example, I want you to list the messages by grouping them with their respective users who have sent them.

In query SELECT * FROM mensagens ORDER BY id it will list all messages, but I want you to list by user you sent. Thank you.

    
asked by anonymous 29.01.2016 / 14:44

1 answer

2
SELECT * FROM mensagens GROUP BY usuario_envia
    
29.01.2016 / 15:04