怎么使我每次不是更新数据库
而是覆盖上次的所有记录呢!
因为有时候时间条件不同
SQL code:
select * from hwouttb where
CAST(REPLACE(REPLACE(REPLACE(outdate,'年','-' ),'月','-'),'日','') AS DATETIME)
between
CAST(REPLACE(REPLACE(REPLACE('2007年10月25日','年','-' ),'月','-'),'日','') AS DATETIME)
and
CAST(REPLACE(REPLACE(REPLACE('2007年10月25日','年','-' ),'月','-'),'日','') AS DATETIME)
and (gysh like '%生產%' or gysh like '%工程%' or gysh like '%倉庫%')
union all
select * from hwouttb2 where
CAST(REPLACE(REPLACE(REPLACE(outdate,'年','-' ),'月','-'),'日','') AS DATETIME)
between
CAST(REPLACE(REPLACE(REPLACE('2007年10月25日','年','-' ),'月','-'),'日','') AS DATETIME)
and
CAST(REPLACE(REPLACE(REPLACE('2007年10月25日','年','-' ),'月','-'),'日','') AS DATETIME)
and (gysh like '%生產%' or gysh like '%工程%' or gysh like '%倉庫%')
什么意思?
看不懂,有请小P梁.
sql少copy的一行
就是第一次假如是100条记录
第二次是50条记录
那么我在数据库hwouttb3
也只有50条刚才的记录
SQL code:
insert into hwouttb3
select * from hwouttb where
CAST(REPLACE(REPLACE(REPLACE(outdate,'年','-' ),'月','-'),'日','') AS DATETIME)
between
C