现在我有两个表,分别是表A、表B
字段如下
表A
userid    username   user_email
表Buserid    username     cid
现在
我通过select * from A,B where A.userid = B.cid and cid > 0 order by B.userid
进行排序。但是问题了来了。我要提取 A.username 和B.username 现在通过act[username]只能提取一个值。如何办?

解决方案 »

  1.   

    补充一下.表B的cid就是表A的userid
      

  2.   

    select A.username ,B.username  
     from A,B where A.userid = B.cid and cid > 0 order by B.userid;
      

  3.   

    这和我的结果不是一样的吗?我的意思是想用什么代替其实的username
      

  4.   

    我的意思是想用什么代替其中的username
      

  5.   

    2楼的方法可以得到 A.username 和B.username  不明白什么意思.
      

  6.   

    这样查询出来不是有两个username吗?现在就是想把其中的一个username换成指定的一个名称。
      

  7.   


    select A.username as  A表的USERNAME ,B.username  as  B表的用户名称 
    from A,B where A.userid = B.cid and cid > 0 order by B.userid;
      

  8.   

    select t_admin_user.username as  admin_name,t_olebar_user.username as olebar_name  
    from t_admin_user,t_olebar_user where t_admin_user.userid = t_olebar_user.cid and cid > 0 order by t_olebar_user.userid