日期:2014-05-16 浏览次数:20748 次
mysql> select a.* from a, a as b where a.uid = 1 and a.uid = b.sid and a.sid = b.uid; +-----+-----+ | uid | sid | +-----+-----+ | 1 | 2 | | 1 | 3 | +-----+-----+ 2 rows in set mysql>
------解决方案--------------------
select * from 表A t1 ,表A t2 where t1.uid=t2.sid and t1.sid=t2.uid wand t1.uid=1