SELECT * FORM u_g as a1, right as a2 WHERE a1.g_id='1' and a1.u_id=a2.id我还不明白你的意思!!凑合写一个

解决方案 »

  1.   

    select p.g_id,p.u_id,i.id  from u_g  p left join right i on p.u_id=i.Pre_id
      

  2.   

    我知道怎么做了!
    select distinct(right.id) from right,u_g where (right.per_id=u_g.g_id and u_g.u_id='"+id+"') or right.per_id='"+id+"' order by id
    这样写没有错!:)
    谢谢大家啦!
    想要分的快点接啊!不然我要结帖了!
      

  3.   

    和我刚回答的一个问题一样!distinct问题;