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

    摘要: 根据条件查询后显示在jsp页面的表单里例如: 编号 名称 单价 数量 金额 1 语文书 20.00 20 400.00 2 数学书 30.00 20 600.00 3 物理书 20.00 10 200.00 在以上数据是while(rst.next())循环后显示的, 在这个表单里名称、单价、数量、金额都是文本框 修改后 编号 名称 单价 数量 金额 1 语文书 10.00 20 200......
    摘要: 一个a1.asp文件写入一个session变量的值 当window.open("xxx.asp") 或<a href="xxx.asp" target="_blank"> 那xxx.asp 里面那个session 值还在不在! ......


()一个表结构很简单的sql问题,oracle中是否能实现

表名:T_1  
  col_1   varchar2   primary   key  
  col_2   varchar2   (该字段可能是非数字字符,也可能是数字字符)  
  ……     ……  
  要求T_1中,所有col_2是数字字符并且col_2   >   100的记录  
  类似:  
  1.select   col_1   from   T_1  
  where   isnumber(col_2)   =   1   and   to_number(col_2)   >   100  
  2.select   col_1   from   T_1  
  where   col_2   >   100   and   isnumber(col_2)   =   1  
  3.select   *   from   (select   to_number(col_2)   A   from   T1    
  where   isnumber(col_2)   =   1)  
  where   A   >   100  
  以上语句都已经经过测试,当col_2包含类似a这样的非数字字符时,该sql大概在to_number(col_2)>100处出错.

NO.1   作者: sbaz

select   col_1,col_2  
  from(  
  select   col_1,  
  (case   when   isnumber(col_2)   =   1   then   to_number(col_2)   else   1   end)   as   col_2  
  from   t_1   )  
  where   col_2>100  
  试看看,我也没机会试!  
 

NO.2   作者: zealot_zk

修改一下:  
   
  select   c.col1,c.col2    
      from   (  
                select   a.col1,a.col2   from   t_a   a  
                    where   exist   (select   1   from   t_a   b   where   isnumber(b.col_2)   =   1   and   a.col2=b.col2)  
                )   c  
      where   to_number(c.col2)>100;  
 


    摘要: bool testbool(bool condition) { for (int i = 0; i < 10; i++) { if (condition) return condition; } } 是不是编译器有关?在vc下testbool(false)= 10 !!!!!! ......
» 本期热门文章:

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