zoukankan      html  css  js  c++  java
  • 临时表的使用

    declare @count3 int,@count7 int,@count int,@countMore int;
    
    select @count3=count(*) from Exam_QuesContent where DateDiff(d,addDate,getdate())<3 --最近三天
    select @count7=count(*) from Exam_QuesContent where DateDiff(d,addDate,getdate())<7 --最近七天
    select @count=count(*) from Exam_QuesContent where DateDiff(d,addDate,getdate())=0 --今天
    select @countMore=count(*) from Exam_QuesContent --更久
    
    if object_id('tempdb..#Tmp') is not null
    Begin
        drop table #Tmp
    End
    create table #Tmp --创建临时表#Tmp
    (
        ID int IDENTITY(1,1) NOT NULL, --创建列ID,并且每次新增一条记录就会加1
        Title  text,  --标题 
        BiaoShi varchar(50),--标示
        Error int     --ID字符串  
    );
    insert #Tmp(Title,BiaoShi,Error)values('今天','today',@count);
    insert #Tmp(Title,BiaoShi,Error)values('最近三天','san',@count3);
    insert #Tmp(Title,BiaoShi,Error)values('最近七天','qi',@count7);
    
    insert #Tmp(Title,BiaoShi,Error)values('更久','more',@countMore);
    select * from #Tmp;
  • 相关阅读:
    flex
    导航守卫 -vue
    H5 History
    JSX -react
    插槽slot -vue
    js 模拟鼠标绘制方块
    js 模拟滚动条
    js 实现简易留言板功能
    js 实现端口列表话
    js 为数组编写该方法;indexOf
  • 原文地址:https://www.cnblogs.com/hougelou/p/3357347.html
Copyright © 2011-2022 走看看