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

 

 ·刪除後重排字段值    »显示摘要«
    摘要: 我想刪除記錄後重排序號字段值為什麼會出錯呢? var nn:integer; begin begin adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add(delete from back_th where nno=+dd+); adoquery1.execsql; adotable1.open; adotable1.edit; w......
 ·谁有jb9 enterprise版下载地址    »显示摘要«
    摘要: 要企业版! 我在borland站上下了一个jb9 enterprise的试用版,只允许我用31天! ......


看似简单,但困扰了我好久的多表查询

我有两个表  
  product记录产品资料  
  字段:  
  PTID  
  PTName  
  TypeID         --可以为null,记录分类Type表的TypeID,有些产品可能没分类  
  ……  
   
  Type表,记录产品类型  
  TypeID  
  TypeName  
  ……  
  我想查询产品纪录时,希望typeid字段存在时显示TypeName,不存在时显示null,  
   
  但我使用inner   join     where   这种方式时,无法将product表里那些TypeID为null的记录查询出来,请大家帮忙想个办法,谢谢

NO.1   作者: Rivulet119

将inner   join该成Left   Outer   Join

NO.2   作者: txlicenhe

Select   a.*,b.TypeName   from   product   a  
  left   join   Type   b   on   a.TypeID   =   b.TypeID  
   
 

NO.3   作者: yujohny

select   A.*,B.TypeName  
  from   product   A   left   join   Type   B   ON   A.TypeID=B.TypeID


    摘要: rt ......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

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