update更新时影响timestamp类型的字段问题

上一篇 / 下一篇  2008-10-30 19:34:30 / 个人分类:mysql

今天在外网更新数据库的时候,出现了一个严重的问题,发现在update更新一张数据表对应的数据时,尽管没有更新timestamp类型的字段 ,但其字段值会已经当前更新时间进行自动更新。

以后还是少用timestamp类型,datetime就可了,解决这个办法可以在创建表的时候进行,软件可以把“刷新当前的时间戳”的选项给去掉!!

 

还要一个问题:在字段为datetime 或 timestamp的 时候

SELECT * FROM t_stat_reg_source


/*范围:'2008-10-23'  --'2008-10-24'*/
where  date(fregtime)  between  '2008-10-23' and  '2008-10-24'

/*范围:'仅2008-10-23' */
where  fregtime  > '2008-10-23' and  fregtime <'2008-10-24'
/*范围:'仅2008-10-23' */
where  fregtime  >= '2008-10-23' and  fregtime <='2008-10-24'

 


TAG: update

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2009-01-08  
    123
45678910
11121314151617
18192021222324
25262728293031

数据统计

  • 访问量: 503
  • 日志数: 42
  • 建立时间: 2008-07-24
  • 更新时间: 2008-12-30

RSS订阅

Open Toolbar