insert into [canonvoie2010ecs].[dbo].[awardnew2]([customerid]
      ,[name]
      ,[sex]
      ,[age]
      ,[job]
      ,[mobile]
      ,[address]) select 
      [customerid]
      ,[user_name]
      ,[sex]
      ,[age]
      ,[job]
      ,[mobile]
      ,[address]
      from 
      [canonvoie2010ecs].[dbo].[SurveySelphy]
      where customerid not in (select customerid from [canonvoie2010ecs].[dbo].[awardnew2])
在这个SQL上加一个时间日期怎么加入?  字段是createdate  时间段是2010-8-10 到 2010-9-10??

解决方案 »

  1.   

    insert into [canonvoie2010ecs].[dbo].[awardnew2]([customerid]
      ,[name]
      ,[sex]
      ,[age]
      ,[job]
      ,[mobile]
      ,[address]) select  
      [customerid]
      ,[user_name]
      ,[sex]
      ,[age]
      ,[job]
      ,[mobile]
      ,[address]
      from  
      [canonvoie2010ecs].[dbo].[SurveySelphy]
      where customerid not in (select customerid from [canonvoie2010ecs].[dbo].[awardnew2])
    and createdate>  '2010-8-10 ' and createdate<'2010-9-10'
      

  2.   


    from 
      [canonvoie2010ecs].[dbo].[SurveySelphy]
      where customerid not in (select customerid from [canonvoie2010ecs].[dbo].[awardnew2])
    and createdate between '2010-8-10 ' and '2010-9-10'