zoukankan      html  css  js  c++  java
  • sql server 语句日志

    ----------建表脚本
    USE [oa]
    GO
    /****** 对象:  Table [ezoffice].[OA_LEAVERETURN_REGISTER]    脚本日期: 04/07/2012 08:57:24 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [ezoffice].[OA_LEAVERETURN_REGISTER](
     [id] [int] IDENTITY(1,1) NOT NULL,
     [userID] [varchar](20) NULL,
     [userName] [varchar](32) NOT NULL,
     [objectName] [varchar](300) NOT NULL,
     [leaveDate] [datetime] NOT NULL,
     [returnDate] [datetime] NULL,
     [photoName] [varchar](200) NULL,
     [remarks] [varchar](200) NULL
    ) ON [PRIMARY]

    GO
    SET ANSI_PADDING OFF

    ---------------增加自动生成id语句
    alter table LeaveReturnRegister add id int identity(1,1);


    ------------------------------------

    insert into ezoffice.OA_LEAVERETURN_REGISTER values('wuyutao2','合肥市保险公司',getdate(),getdate(),'20120402_3456','');

    select * from ezoffice.OA_LEAVERETURN_REGISTER order by id desc


    delete ezoffice.OA_LEAVERETURN_REGISTER where 1=1 and ( id=1 or id=2 or id=3)
    ----拼接字符串
    update ezoffice.OA_LEAVERETURN_REGISTER set empName=convert(varchar(100),id)+empName

    insert into ezoffice.OA_LEAVERETURN_REGISTER values('wuyutao2','合肥市保险公司',getdate(),getdate(),'20120402_3456','');

    select * from ezoffice.OA_LEAVERETURN_REGISTER order by id desc


    delete ezoffice.OA_LEAVERETURN_REGISTER where 1=1 and ( id=1 or id=2 or id=3)
    update ezoffice.OA_LEAVERETURN_REGISTER set returndate=returndate+id

    select leavedate+1,returndate+1 from ezoffice.OA_LEAVERETURN_REGISTER order by id desc

    update ezoffice.OA_LEAVERETURN_REGISTER set empName=convert(varchar(100),id)+empName


    (('2012-04-23 08:25:13' > po.leaveDate and  '2012-04-28 08:25:13' < po.leaveDate) or ('2012-04-23 08:25:13' > po.returnDate and  '2012-04-28 08:25:13' < po.returnDate))


    select * from ezoffice.OA_LEAVERETURN_REGISTER where '2012-04-23 08:25:13' < leavedate and '2012-05-23 08:25:13' >leavedate

    select * from ezoffice.org_employee


    select max(id) from ezoffice.OA_LEAVERETURN_REGISTER

    select * from ezoffice.OA_LEAVERETURN_REGISTER order by id desc
    select * from ezoffice.OA_LEAVERETURN_REGISTER  where empName='104104蒋正'

    update ezoffice.OA_LEAVERETURN_REGISTER set returndate=null where id =104

  • 相关阅读:
    Eval与DataBinder.Eval的区别
    ETL增量抽取方式
    SPSS Clementines 预测分析模型啤酒+尿片故事的实现机理(转载)
    【转载】SPSS Clementine 数据挖掘入门3
    SSIS 包配置的过程
    SPSS Clementine 数据挖掘入门2(转载)
    SPSS19.0实战之聚类分析(转载)
    SPSS Clementine 数据挖掘入门1(转载)
    【转】ASP网站源代码修改方法
    【转】【转】一个一年工作经验的java工程师从工作初到今天的所有收藏的学习java的网站(有些很经典
  • 原文地址:https://www.cnblogs.com/anuoruibo/p/2442268.html
Copyright © 2011-2022 走看看