你可以这样试一下:
select distinct a.asker,b.name,c.nsrh from  note a,nsr b where a.asker=b.nsrh;

解决方案 »

  1.   

    在note表中增加一字段id,成为:note(id,asker);
    select note.asker from nsr,operator where note.id=nsr.nsrh or note.id=operator.operatirid;
      

  2.   

    note和nsr或者operator关联一下即可得到了。
      

  3.   

    select nsr.name from nsr,note where nsr.nsrh=note.asker
    union
    select operator.name from operator,note where operator.operatorid=note.asker;
      

  4.   

    如果是指定的asker,
    select nsr.name from nsr,note where nsr.nsrh=note.asker and note.asker=指定的asker
    union
    select operator.name from operator,note where operator.operatorid=note.asker and note.asker=指定的asker;
      

  5.   

    TO:zsz78(zsz) 
    你只关联了一个表
    TO:BlueskyWide(谈趣者) 
    你显示的结果不是我想要的举列:
    note:1
         2
         3
    --------------------
    ask: 1 ab
         2 bc
    --------------------
    operator: 3  cd
    ---------------------
    我想要的结果是
    name
    ab
    bc
    cd
    或者
    ask.name operator.name
    ab
    bc
               cd
      

  6.   

    若是asker也唯一:
    select (select name from nsr where nsrh=asker) nname,(select name from operator where operatorid=asker) oname from note;以下另一种效果:
    select name from  nsr where exists(select 1 from note where nsrh=asker)
    union
    select name from operator where exists(select 1 from note where operatorid=asker)
      

  7.   

    select ask.name, operator.name from note,ask,operator
    where note.asker=ask.nsrh(+) and note.asker=operator.operatorid(+)
      

  8.   

    TO : beckhambobo(beckham)
    你的第2中方法可以实现我要的第2种效果
    第一种的结果是把重复的都过滤调了
    我希望是
    note:1
         2
         2
         2
         3
    --------------------
    ask: 1 ab
         2 bc
    --------------------
    operator: 3  cd
    ---------------------
    我想要的结果是
    name
    ab
    bc
    bc
    bc
    cd
      

  9.   

    select nsr.name name from nsr,note where nsr.nsrh=note.asker
    union
    select operator.name name from operator,note where operator.operatorid=note.asker;
      

  10.   

    select nsr.name from nsr,note where nsr.nsrh=note.asker
    union all
    select operator.name  from operator,note where operator.operatorid=note.asker;