This question has already been answered:
- Query sql message selection 2 responses
I make a chat. The database has the following structure:
Сущность Chat id text_message id_user_from id_user_to You must get a list of conversations (that is, all non-repeating entries at the same time id_user_from and id_user_to ). Is it possible to somehow do this using SQL ?
I apologize, the question may be stupid, but I am not particularly strong in SQL .
Here is the upper table. This is the complete list of messages in the dialogue. And the lower table is what I want to receive.
That is, all non-repetitive combinations id_user_from! And! id_user_to
