There are table messages and fields: id - message ID author - Message author poluchatel - Message recipient text - Message text
There are 4 posts:
id - 1 author - Kolya poluchatel - Julia text - Hi Julia!
id - 2 author - Petya poluchatel - Julia text - Hi Julia!
id - 3 author - Peter poluchatel - Julia text - Hi Julia!
id - 4 author - Vasya poluchatel - Julia text - How are you?
I need to display all messages, where (poluchatel is Yulia), all authors who sent her a message, and only one of their last messages! Here are the messages that should be displayed:
id - 1 author - Kolya poluchatel - Julia text - Hi Julia!
id - 3 author - Peter poluchatel - Julia text - Hi Julia!
id - 4 author - Vasya poluchatel - Julia text - How are you?