zoukankan      html  css  js  c++  java
  • 无名

    reate or replace procedure SP_PageQuery
    (p_StrQuery in varchar2,
    p_CurPage in out integer,
    p_PageSize in out Integer,
    p_TotalRecords out integer,
    p_TotalPages out integer,
    v_cur out SYS_REFCURSOR
    )
    is
    v_strsql varchar2(4000):='';
    v_FirstRecord  integer;
    v_LastRecord   integer;
    begin
    if( p_StrQuery is not null) then
    v_strsql:= 'select count(*) from ( '|| p_StrQuery ||') where 1=1';
       EXECUTE IMMEDIATE v_strsql  into p_TotalRecords ;
    end if;
    if(p_PageSize<0) then
    p_PageSize:=0;
    end if;
    if(mod(p_TotalRecords,p_PageSize)=0) then
    p_TotalPages := p_TotalRecords/p_PageSize;
    else
    p_TotalPages := p_TotalRecords/P_PageSize;
    end if;
    if(p_CurPage<1) then
    p_CurPage :=1;
    end if;
    if(p_CurPage>p_TotalPages) then
    p_CurPage :=p_TotalPages;
    end if;
    v_FirstRecord :=(p_CurPage - 1) * p_pageSize + 1;
    v_LastRecord  := p_CurPage*p_PageSize ;
    v_strsql:=' with t1 as (select rownum as xh,a.* from ('
    || p_StrQuery ||' )  a) select t1.* from t1  where xh >= '
    || v_FirstRecord ||
    ' and xh<= '
    ||v_LastRecord;
    open v_cur for v_strsql;
    end SP_PageQuery;

    一:

    SELECT CASE WHEN CONVERT(varchar(10),lastpasstime,120)='2009-12-08' THEN ''
     ELSE CONVERT(VARCHAR(20),lastpasstime,120) END a,* FROM users

    二:select replace (CONVERT(VARCHAR(20),lastpasstime,120),‘lastpasstime’,'') from users

  • 相关阅读:
    网络编程
    正则表达式
    对空气质量历史数据的爬取
    通过移动设备行为数据预测性别年龄
    电影口碑与海报图像的相关性分析
    微博情感分析
    《python3网络爬虫开发实战》--验证码的识别
    python编程快速上手
    Echarts树图定制详解
    Servlet学习笔记【2】---Http数据包
  • 原文地址:https://www.cnblogs.com/umlzhang/p/1837636.html
Copyright © 2011-2022 走看看