I need some tip for mysql select where I dont know what to do.
I do have a table with rows like this
POST | NAME | FOTO | USER_ID | SENDER_ID | TEXT |
Now I want to select DESTINCT all results but not the ones where SENDER_ID = 1000 AND USER_ID NOT 2000
but only in this combination. For example I want all with SENDER_ID = 1000 but USER_ID =! 1000 and the opposite but not IF BOTH are the the numbers I want to exclude.
I could of course first select all and than via php exclude this ones with a simple if but then I get less results. If I select for example with limit 10 and later I check with php if to exclude maybe 2-3 of the result I would end up with only 7 rows to display which would be strange for the layout. So I try to exclude them already during the select if possible.
I hope I did explain it well enough and somebody can help me on the right way.
thank you for all tips