--CREATE DATABASE EXAM_1 --GO USE EXAM_1 --判断并删除表 IF OBJECT_ID('Scores') IS NOT NULL DROP TABLE Scores; GO IF OBJECT_ID('Courses') IS NOT NULL DROP TABLE Courses; GO IF OBJECT_ID('Students') IS NOT NULL DROP TABLE Students; GO IF OBJECT_ID('Teachers'
create table test ( bizdate datetime, --日期 classes varchar(50), --班次 '白班' 或 '夜班' qty int --产量 ) insert into test select '2011-04-01','白班',154 union select '2011-04-01','白班',400 union select '2011-04-02','夜班',40 union select '2011-04-02','白班',1
use ResourceShare --统计使用情况 alter PROCEDURE StaSheryUse @start datetime, @end datetime, @orgId int AS BEGIN create table #Month ( id ,) primary key not null, [year] int not null, [month] int not null ) --计算全文传递数 ) fulltextCount,YEAR(CreateDate) [year]