当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·简单问题    »显示摘要«
    摘要: <html> <body> <table> <tr> <td id=tdtest name=tdtest> </td> </tr> </table> <script language="javascript"> parent.document.getelement......
 ·关于sequence值的疑惑    »显示摘要«
    摘要: 在sql提示符下输入: select seq_name.currval from dual; 有时会显示错误信息: “seq_name未在此进程中定义” 而此时若在应用程序中使用它读出seq_name的值又不会出错 why? ......


一关联查询的问题

表a为主表  
  id  
  xm  
  gh  
  表b为从表  
  id  
  xx  
  cc  
  select   a.*,b.*   from   a,b   where   a.id=b.id   and   a.id=1  
  这样一来,上面那个记录几为多条记录,  
  我想的到  
  select   *   from   a   where   a.id=1(一条记录)  
  再把  
  select   xx   from   b   where   b.id=1中的结果和上面几录合在一起  
  如何写  
   
   
   
   
 

NO.1   作者: caiyunxia

select   distinct   a.*,b.*   from   a,b   where   a.id=b.id   and   a.id=1  
 

NO.2   作者: CrazyFor

这是因为你的b表中id=1的记录有很多条的原因,

NO.3   作者: caiyunxia

select   c.*,b.*  
  from   (select   1,xm,sum(gh)   as   gh   from   a   where   a.id=1   group   by   xm   )   c   ,   b   where  
  c.id=b.id      
 

NO.4   作者: tj_dns

select   a.*,b.xx   from   a,b   where   a.id=b.id   and   a.id=1  
 

NO.5   作者: safenxiao

select   a.id,a.xm,a.gh,b.xx   from   a,b   where   a.id=b.id   and   a.id=1


    摘要: 如何实现vs.net中的工具箱实现自动伸缩的那一种,请祥细告知! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE