Answer the question
In order to leave comments, you need to log in
How to write the right query for one table?
There is a table with users:
id | from_id | to_id
-----------------
1 | 20 | 32
2 | 76 | 10
Answer the question
In order to leave comments, you need to log in
well let's say this:
select *
from `table_name`
where (from_id = 32 and to_id = 20)
or (from_id = 20 and to_id = 32)
limit 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question