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

 

 ·在oracle中可以调外部的程序吗    »显示摘要«
    摘要: 在oracle的存储过程或触发器中可以调外部程序吗?比如在windows可以像ms sql那样调api,或是com+。 oracle有这样的功能吗? 我以oracle不是太了解,提了弱智问题,请大家原谅. ......
 ·网路维他来接分啦    »显示摘要«
    摘要: 谢谢你啦~~ ......


这句SQL怎么写

table1  
  id   title   content    
  1       aa           a1a1  
  2       bb           b2b2  
  3       cc           c3c3  
  4       dd           d4d4  
  .........  
  table2  
  id     sid       name  
  1         1           w  
  2         1           n  
  3         2           q  
  ........  
  table2中的sid中存table1中的id,table1和table2是一对多的关系,2个表都做了全文索引,现在根据关键字在2个表中查询,要求返回tabl1的title,content,table2中对应table1的name  
   
  也就是一条记录对应多个附件的全文检索问题,请大家帮忙

NO.1   作者: yoki

select   table1.title,table1.content,table2.name   from   table1   table2    
  where   table1.id   =   table2.sid  
   
  or  
   
  select   table1.title,table1.content,table2.name   from   table1    
  inner   join   table2   on   table1.id   =   table2.sid  
   
 

NO.2   作者: CrazyFor

要不重复,只要保证派生的表2里的记录不重复。如:  
   
  select   table1.title,table1.content,tem.name   from   table1    
  inner   join   (select   sid,name   from   table2   group   by   sid,name)tem   on   table1.id   =   tem.sid   where   contains(*,关键字)  
 


    摘要: 我真是笨女生啊,结贴的时候,密码写错了,可是为什么没有提示我密码错了呢:( 我写的错密码 有十二位,可是系统却没有提示 ......
» 本期热门文章:

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