当前位置: 代码迷 >> Sql Server >> 请问一个查询优化有关问题
  详细解决方案

请问一个查询优化有关问题

热度:54   发布时间:2016-04-24 23:16:37.0
请教一个查询优化问题
我使用MS-SQL 2008 建了如下两表:

if exists (select 1
            from  sysobjects
           where  id = object_id('T_CANVERSION')
            and   type = 'U')
   drop table T_CANVERSION
go

/*==============================================================*/
/* Table: T_CANVERSION                                          */
/*==============================================================*/
create table T_CANVERSION (
   versionID            int                  identity
        constraint CKC_VERSIONID_T_CANVER check (versionID >= 1),
   versionName          varchar(30)          not null,
   groupID              char(9)              not null,
   carType              int                  not null,
   constraint PK_T_CANVERSION primary key  (versionID)
)
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_CANDATA')
            and   type = 'U')
   drop table T_CANDATA
go

/*==============================================================*/
/* Table: T_CANDATA                                             */
/*==============================================================*/
create table T_CANDATA (
   intID                int                  identity
        constraint CKC_INTID_T_CANDAT check (intID >= 0),
   strCtrlorName        varchar(50)          not null,
   strCanID             varchar(20)          not null,
   intOperate           int                  not null,
   intStByte            int                  not null,
  相关解决方案