I have the users data in mysql table like below
| Index_No | Message_From | Message_To | Message | Message_Time(Current TimeStamp) |
|---|---|---|---|---|
| 01 | 123@mail.com | 009@mail.com | hello 009 | 2022-04-24 12:26:13 |
| 02 | 567@mail.com | 008@mail.com | hi 567 | 2022-04-24 12:27:13 |
| 03 | 123@mail.com | 009@mail.com | how are you | 2022-04-24 12:28:13 |
| 04 | 567@mail.com | 008@mail.com | How is the weather | 2022-04-24 12:29:13 |
I need to show the latest record of each user like
| Index_No | Message_From | Message_To | Message | Message_Time(Current TimeStamp) |
|---|---|---|---|---|
| 03 | 123@mail.com | 009@mail.com | how are you | 2022-04-24 12:28:13 |
| 04 | 567@mail.com | 008@mail.com | How is the weather | 2022-04-24 12:29:13 |
I am using MySQL does any one know how i will achieve the required result?