SELECT one WHERE two=2 AS F1 AND two WHERE one=2 AS F2
SELECT one WHERE two=1 AS M1 AND two WHERE one=1 AS M2
所以,当我加入F1 and M1
和F2 and M2
时,它只会选择与两个WHERE one = 1 or 2
编号相同且与WHERE two = 1 or 2
编号相同的行,所以当它分组并回显它将回显标记为与颜色分组的数字。这是我的疑问:
SELECT * FROM friends AS f5
INNER JOIN
((SELECT one FROM friends WHERE two = '1') AS f1,
(SELECT two FROM friends WHERE one = '1') AS f2,
(SELECT one FROM friends WHERE two = '2') AS m1,
(SELECT two FROM friends WHERE one = '2') AS m2)
ON (f1.one = m1.one AND f2.two = m2.two )
但是当我在sql中查询此代码时,它显示了一个空结果。请帮忙吗?