[TABLE1]
+----------+-------------------+
| USERNAME | POST |
+----------+-------------------+
| Bob | 'Hi There' |
| Jack | 'Hello' |
| Bob | 'Today is Monday' |
+----------+-------------------+
[TABLE2]
+----------+-----------+
| USERNAME | FOLLOWING |
+----------+-----------+
| Mike | Jack |
| Jack | Bob |
| Bob | Jack |
| Jack | Mike |
+----------+-----------+
我正在使用这个 join 语句:
SELECT t1.* FROM TABLE1 t1 INNER JOIN table2 t2
ON t1.username = t2.following AND t2.username = 'jack';
这可行,但除了返回这些结果之外,我还想添加“OR t1.USERNAME = 'jack';
然后是另一个 OR .. 有没有办法进行连接,但还有一个 OR 语句