Sorry about the confusing title. Couldnt come up with better.
Well I have table messages with fields id, from, to, message
Lets say there are messages from John and Nate for Dave
so it would look like that
id|from|to|message
1|John|Dave|Hey
2|Nate|Dave|Yooo
3|John|Dave|Sup
4|Nate|Dave|Waazza
Imagine there is more of them tho.
Ok I want to extract messages for Dave and I do it like that
SELECT * FROM messages WHERE ˙to` = 'Dave' ORDER BY id ASC
Ok all fine but this shows messages from both John and Nate.
Is there a way I could extract messages only from either(one) of them? Like I would extract only messages from John.
I am aware of doing another WHERE statement but I am looking for solution where I know only for who are messages not from who