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

 

 ·求个参考程序或者是说明文档    »显示摘要«
    摘要: 哪位手中有jbuilder7以上+weblogic7开发cmp东西,要有关联的1-m,1-1-m-n的,最好有步骤的,兄弟我先谢了 kofwr@sohu.com ......
    摘要: 有一个从文件中读出了的指针字符,其中有空格,也有换行符,请问把这个字符显示在那种控件中比较好,要求其有换行符的地方要换行,而且如果两个换行符之间的字符在这个控件的一行放不下,可以自动换行。 下面是我读文件的语句: char *content; int num,ret,length; fseek(fp,0l,seek_end); length=ftell(fp); content=(char......


寻一句SQL语句

现有一表    
  现要求SQL语句查询出表中所有重复的记录。最后删除。    
 

NO.1   作者: Yang_

查询:  
  select   *   from   tablename  
  where   A+B*C   in   (select   A+B*C   from   tablename   group   by   A+B*C   having   count(*)>1)  
   
 

NO.2   作者: dlkfth

楼上正确

NO.3   作者: Yang_

删除:  
   
  delete   x  
  from   tablename   x  
  where   A+B*C   in   (select   A+B*C   from   tablename   group   by   A+B*C   having   count(*)>1)  
  and   (a<>(select   min(a)   from   tablename   where   A+B*C=x.A+x.B*x.C)  
  or   b<>(select   min(b)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a)  
  or   c<>(select   min(c)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a   and   b=x.b)  
  or   d<>(select   min(d)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a   and   b=x.b   and   c=x.c)  
  or   e<>(select   min(e)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a   and   b=x.b   and   c=x.c   and   d=x.d)  
  or   f<>(select   min(f)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a   and   b=x.b   and   c=x.c   and   d=x.d   and   e=x.e)  
  or   g<>(select   min(g)   from   tablename   where   A+B*C=x.A+x.B*x.C   and   a=x.a   and   b=x.b   and   c=x.c   and   d=x.d   and   e=x.e   and   f=x.f)  
  )  
   
   
  注:如果有主键,没有这么麻烦。  
 

NO.4   作者: ZHANGWEI15

select   A,B,C,D,E,F,G,a+B*C   as   x   into   #t1       from   tbname    
  select   distinct   x       into   #t2   from   #t1  
   
  --delete   table  
  drop   table   tbname  
   
  --rebuild   table  
  select   #t1.*   into   tbname     from   #t1   inner   join   #t2  
  on   #t1.x=#t2.x

NO.5   作者: shuixia

delete   from   tablename   where   field1   not   in   (  
                select   field1   from   tablename   as   tn   where   field1   in   (  
                              select   top   1   field1   from   tablename   where   field2=tn.field2))


    摘要: 我想制作一个listview控件 在上面实现右键菜单弹出颜色选择 然后设置listview控件的底色 请高手们将操作说的详细点 我菜鸟嘛 :) ......
» 本期热门文章:

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