1.select a.id,amc,b.bmc,c.cmc from a,b,c where a.tableB=b.id and a.tableC=c.id and a.id=?
2.上面的就行。

解决方案 »

  1.   

    select (select max(bmc) from b where b.id=a.idb),
    (select max(cmc) from c where c.id=a.idc)
    from a
    where ...;select (select max(amc) from a where a.idb=b.id)
    from b
    where bmc='...'使用max()是为了防止 子查询返回多行的 错误
      

  2.   

    +1个问题
    3.怎么在获取tableA的id(及jsp获取的newBMC,newCMC),后更新和他相对应的tableB和tableC中的BMC和CMC.
      

  3.   

    select b.BMC,c.CMC from tablea a,tableb b,tablec c where 
    a.tableB=b.ID and a.tableC=c.ID and a.ID=XXXselect a.AMC from tablea a,tableb b,tablec c where 
    a.tableB=b.ID and a.tableC=c.ID and b.BMC=XXX and c.CMC=XXX
      

  4.   

    Create view v_name is
    begin
     select a.ID,b.BMC,c.CMC from tablea a,tableb b,tablec c where 
    a.tableB=b.ID and a.tableC=c.ID
    End;
    /
    update v_name set BMC=XXX,CMC=XXX where ID=XXX;
      

  5.   

    1.
    select 
        b.BMC ,
        c.CMC
    from 
        tablea a,
        tableb b,
        tablec c
    where 
            a.tableb=b.id
        and a.tablec=c.id
        and a.id=你的id2.
    select 
        a.AMC
    from 
        tablea a,
        tableb b
    where
            a.tableb=b.id
        and b.BMC=你的BMC值--如果用表C的话改一下就行了