zoukankan      html  css  js  c++  java
  • sql 生成javabean实体

    select a.name,c.name,b.name,
    'private String '+lower(c.name)+';'
    from sysobjects a, systypes b, syscolumns c
    where a.xtype = 'u'
    and a.id = c.id
    and b.xtype = c.xtype
    and b.name <> 'SYSNAME'
    and a.name='T_EVALUATION'
    order by c.id;

    select 'private String ' || lower(c.COLUMN_NAME) ||';' from user_tab_columns c where c.table_name='A_JZZ'

    select a.name,c.name,b.name,
    'private String '+lower(c.name)+';'
    from sysobjects a, systypes b, syscolumns c
    where a.xtype = 'u'
    and a.id = c.id
    and b.xtype = c.xtype
    and b.name <> 'SYSNAME'
    and a.name='T_EVALUATION'
    order by c.id;

    select 'private String ' || lower(c.COLUMN_NAME) ||';' from user_tab_columns c where c.table_name='A_JZZ'

    create function PoNumber(@a datetime) returns varchar(50)
    begin
    declare @id varchar(50),@i int
    select top 1 @id=pono from dbo.po where left(pono,8)= convert(varchar(8),@a,112) order by pono desc
    if @@rowcount=0
    return convert(varchar(8),@a,112)+'001'
    set @i= rtrim(right(@id,3)) +1
    set @id=rtrim(@i)
    return convert(varchar(8),@a,112)+right( '000'+@id ,3 )
    end


    select aa.*,
    case when cast(aa.ProduceSize as decimal(9,2)) > 0 then aa.ProduceSize + 'ถึ'
    when cast(aa.ProduceSize2 as decimal(9,2)) > 0 then aa.ProduceSize2 + 'ึป'
    when cast(aa.ProduceSize as decimal(9,2)) = 0 and cast(aa.ProduceSize2 as decimal(9,2)) = 0 then aa.ProduceSize + 'ถึ'
    else aa.ProduceSize end wwwww,
    bb.LICENCEID aaaaa,bb.zhuanyiliang,
    cast((cast(aa.ProduceSize as decimal(9,2))-
    cast(case when bb.zhuanyiliang IS null or bb.zhuanyiliang IS NULL then '0' else bb.zhuanyiliang end as decimal(9,2))
    ) as nvarchar) + 'ถึ' ccc
    from (
    select LicenceID,LicenceName,Address,i.conname,isnull(ProduceSize,0) ProduceSize,isnull(ProduceSize2,0)ProduceSize2,CertificalTime,PeriodTime
    from T_Licence left join T_COMMON_INFO i on T_Licence.RegionCode= i.CONCODE and i.objtype='101') aa
    left join (
    select LicenceID,SUM(cast(DangerCount as int)) as zhuanyiliang from
    T_TranferDetail group by CORPID,LicenceID) bb
    on aa.LICENCEID = bb.LICENCEID;

    select (cast('22.0' as decimal(9,2))- cast('12.00' as decimal(9,2))) ccc;

  • 相关阅读:
    C++11 新特性之 变长參数模板
    Cocos2dx 3.6源代码编译错误:syntax error : missing &#39;)&#39; before &#39;{&#39;
    android开发中,在java中怎样使用c提供过来char*
    cocos2d-x 3.1.1 学习笔记[11] http请求 + json解析
    T420s成功加装固态硬盘(SSD)
    我对GFWed的一些自己的见解
    css样式布局中position的那些事儿
    Tokyo Tyrant(TTServer)系列(一)-介绍和安装
    Linux 文件描述符和重定向
    装饰模式
  • 原文地址:https://www.cnblogs.com/lovelanglangyou/p/9045300.html
Copyright © 2011-2022 走看看