我写了一条修改的sql语句,执行时一直执行不了,报错“命令未正确结束”
哪位能告诉我这是哪里出错了? update safe_task set orderno=3 and sname='aaaa' and sarea='dd' 
 and startdate=to_date('2011-02-11','yyyy-mm-dd') and re='d' and state='c' 
 and stype='ff' and monthdate=('2011-02-12','yyyy-mm-dd') where projectno='10003'

解决方案 »

  1.   

    set 多个字段不是用 and 连接,是用“ ,”逗号连接
      

  2.   


    --不要用and
    update safe_task 
    set orderno=3,sname='aaaa',sarea='dd',
        startdate=to_date('2011-02-11','yyyy-mm-dd'),re='d',state='c',stype='ff',
        monthdate=('2011-02-12','yyyy-mm-dd')
    where projectno='10003'
      

  3.   

    谢了!!oracle的sql语句和sql server的语法不同吗?
      

  4.   

    SQL不完全一样 差异还是有的
      

  5.   

     update safe_task_solution set orderno=3,sname='aaaa',sarea='dd', 
     startdate=to_date('2011-02-11','yyyy-mm-dd'),re='d',state='c', 
    stype='ff',monthdate=('2011-02-12','yyyy-mm-dd') where projectno='10003'我这样改了之后,红色逗号那里一直报错“缺失右括号” 可是我没少写括号啊
      

  6.   


    --少了to_date函数
    update safe_task_solution set orderno=3,sname='aaaa',sarea='dd',  
     startdate=to_date('2011-02-11','yyyy-mm-dd'),re='d',state='c',  
    stype='ff',monthdate=to_date('2011-02-12','yyyy-mm-dd') where projectno='10003'