Jump to content
Fórum Script Brasil
  • 0

Ajuda com Select


ahhmulek

Question

Tenho a seguinte tabela

Captur.png

Eu quero q o select me retorne a ultima message q o author_id deixou para o recipient_id

Ex:

o Joao(author_id) mandou 3 mensagens para o Pedro(recipient_id)

o Mario(author_id) tb mandou 3 mensagens para o Pedro(recipient_id)

Eu quero procurar as mensagens em que o recipient_id = Pedro e me mostre somente a ultima msg de cada usuario.

A ultima msg q Joao enviou para Pedro e a ultima msg q Mario enviou para Pedro.

O valor da coluna author_id não pode se repetir.

Vlws :D

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...