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

 ·typedef的一个问题    »显示摘要«
    摘要: 在看到的代码中,很多定义结构的时候都是这样定义的 typedef struct xxx{ …… }xxx; 为什么不直接 struct xxx{ …… }xxx; 而要在struct前面加上一个typrdef呢?这样做有什么好处呢? 请高手指教。 ......
    摘要: 有这样一个字符串 ┃二、aaaddd ┃ 40,000,000.00┃ 40,000,000.00┃ 40,000,000.00┃ 40,000,000.00┃ 40,000,000.00┃ 其中┃是全角字符 想取出二、aaaddd 40,000,000.00 等结果! 不知如何分?谢谢! ......


求助 如何删除最后的表数据

有一个表a   ,表内有100行数据,我想删除最后的10,请问如何实现?

NO.1   作者: zlqs

delete     from   (select   *   from   test_tab   order   by   tab_id   desc   )   where   rownum<10

NO.2   作者: welyngj

我觉得需要添加一个字段存储插入时间。

NO.3   作者: zlqs

delete     from   (select   *   from   test_tab   order   by   rowid   desc   )   where   rownum<10  
 

NO.4   作者: zgh2003

以前好象做过这样的题:  
  delete     from   (select   *   from   test_tab   order   by   rownum   desc   )   where   rownum<11  
  你试试,应该可以,操作之前最好做个备份,预防...

NO.5   作者: letsflytogether

楼上的方法可以一试

NO.6   作者: beckhambobo

SQL>   select   *   from   a  
      2     ;  
   
                NUM  
  ----------  
              1.23  
                    1  
            1.456  
   
  SQL>   select   last_value(num)   over(order   by   rownum   desc)   from   a;  
   
  LAST_VALUE(NUM)OVER(ORDERBYROW  
  ------------------------------  
                                                    1.456  
                                                            1  
                                                      1.23  
   
  哪么你的表假如有主键num,就可以写成以下  
  delete   from   a   where   num   in   (select   num   from   (select   last_value(num)   over(order   by   rownum   desc)   from   a)   where   rownum<=10);


    摘要: mysql创建新表的时候字段数 是什么意思,通常填写多少位的 ......
» 本期热门文章:

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