zoukankan      html  css  js  c++  java
  • 常用SQL

     1 --选出相同行
     2 SELECT *
     3 FROM I_KHXXGZSJWH a
     4 WHERE ( ( SELECT COUNT(*)
     5 FROM I_KHXXGZSJWH
     6 WHERE KEHBM = a.KEHBM
     7 ) > 1 )
     8 ORDER BY KEHBM DESC
     9 
    10 
    11 --选出某列 求和
    12 SELECT SUM(LJKPJE) from I_KPXX WHERE WBSYS='S-201401012.A';
    13 
    14 
    15 --删除流程脚本
    16 begin
    17 use H3Cloud
    18 delete from OT_InstanceContext
    19 delete from OT_Token
    20 delete from OT_WorkItem
    21 delete from OT_Attachment
    22 DELETE FROM [dbo].[I_电脑信息更新后子表]
    23 DELETE FROM [dbo].[I_电脑信息更新前子表]
    24 DELETE FROM [dbo].[I_机房硬件更新后子表]
    25 DELETE FROM [dbo].[I_机房硬件更新前子表]
    26 DELETE FROM [dbo].[I_加班备案记录_GROUP1]
    28 end
    30 begin
    31 use H3
    32 delete from dbo.ActivityMap
    33 end

    --查询表objectID字段的最大值+1作为ObjectID字段输出
     SELECT MAX(convert(INT,ObjectID))+1 AS ObjectID FROM I_KHXXGZSJWH 
  • 相关阅读:
    proc文件系统面面谈
    如何创建,增加SWAP?
    使用linux中的fdisk无损坏合并分区
    QEMU+Accelerator
    QEMU网络配置
    Linux主机设NAT
    试用QEMU,安装个FreeBSD 5.3
    QEMU简介
    使用Vesa2
    BugFree介绍
  • 原文地址:https://www.cnblogs.com/dazhangyu/p/4961952.html
Copyright © 2011-2022 走看看