I have two table as below
match
id (PK)
match_id
name
birthdate
bio
message_long
id (PK)
message
from_id
to_id
match_id (FK to match_on on match table)
unix_timestamp
These two tables are responsible for storing chat conversation logs. I can retreive a conversation by the following sql query
select * from message_log where match_id = '2434';
I would like to come up with an sql query that would return the match_ids of conversations only if:
- The last message (last message received) in the conversation (match_id) is not from '765' (from_id column)
Can someone please help me construct this sql query?