update T set leave = now()  where id =1 ;
出现如下错误:
1064-You have an error in your SQL syntax;check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave =now () where id =1' at line 1请问如何修改这属性为当前的时间,菜鸟求救!!

解决方案 »

  1.   

    update T set leave = getdate() where id =1 
      

  2.   

    兄弟你学.NET 的吧
    sql 取当前时间的是  getdate()
      

  3.   

    将leave = now()改为如下的
    update T set leave = getdate() where id =1
      

  4.   

     create table test_table( 
    id integer not null auto_increment primary key, 
    stamp_created timestamp default '0000-00-00 00:00:00', 
    stamp_updated timestamp default now() on update now() 
    ); 
      

  5.   

    我写的是jsp项目,访问mysql的数据库后来小弟我这样解决了:
    String command = "UPDATE `visitor` SET `leave`=(select now()) WHERE id= "+ id;我调用的是mysql中的函数,好纠结的语法问题,我是参考mysql的Navicat工具,然后生成语句
      

  6.   

    leave  是MySQL的保留字,使用时加引号 `,(不是单引号',而是英文状态下~那个键上的单引号)
    你在建表时应该处理过这个问题,
    上面的语句改成  update t set `leave`=now() where id=1 就行。