select * from 客户表 a left join 用户表 b
on a.user_id=b.user_id
left join 用户表 c
on a.user_id2=c.user_id
left join 用户表 d
on a.user_id3=d.user_id

解决方案 »

  1.   

    select a.c_id, b.user_name,c.user_name,d.user_name from 客户表 a
    left join 用户表 b on a.user_id = b.user_id 
    left join 用户表 c on a.user_id2 = c.user_id
    left join 用户表 d on a.user_id3 = d.user_id 
      

  2.   


    select c_id,
    (select user_name from 用户表 where user_id=c.user_id) as 所属客服,
    (select user_name from 用户表 where user_id=c.user_id2) as 跟踪客服,
    (select user_name from 用户表 where user_id=c.user_id3) as 售后客服
    from 客户表 c