delete from后面只能接一个表,语法就是delete from 表名,中间不能加东西

解决方案 »

  1.   

    额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
      

  2.   

    额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql可以哪样?  这和比不比的上无关吧,只是标准不一样吧。 
    我感觉mysql有些语法是没有oracle严格,但是这也不能说mysql就好
      

  3.   

    DELETE 动做不能做表连接,你可以在WHERE子句后面加上子查询
      

  4.   

    额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql也不可以这样用啊mysql> delete * from tmp;
    ERROR 1064 (42000): 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 '* fro
    m tmp' at line 1
    mysql> delete * from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 '* fro
    m tmp left join tmp2 on tmp.name=tmp2.name' at line 1
    mysql> delete from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 'left
    join tmp2 on tmp.name=tmp2.name' at line 1
    mysql>
      

  5.   

    额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql也不可以这样用啊mysql> delete * from tmp;
    ERROR 1064 (42000): 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 '* fro
    m tmp' at line 1
    mysql> delete * from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 '* fro
    m tmp left join tmp2 on tmp.name=tmp2.name' at line 1
    mysql> delete from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 'left
    join tmp2 on tmp.name=tmp2.name' at line 1
    mysql>
    你写错了,额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql也不可以这样用啊mysql> delete * from tmp;
    ERROR 1064 (42000): 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 '* fro
    m tmp' at line 1
    mysql> delete * from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 '* fro
    m tmp left join tmp2 on tmp.name=tmp2.name' at line 1
    mysql> delete from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 'left
    join tmp2 on tmp.name=tmp2.name' at line 1
    mysql>你写错了,是这样的。。delete a.* from aa as a left join bb as b  on a.b_id=b.b_id;
    delete a from aa as a left join bb as b  on a.b_id=b.b_id
    [SQL]delete a.* from aa as a left join bb as b  on a.b_id=b.b_id;
    受影响的行: 0
    时间: 0.000s[SQL]
    delete a from aa as a left join bb as b  on a.b_id=b.b_id受影响的行: 0
    时间: 0.001s
      

  6.   

    额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql也不可以这样用啊mysql> delete * from tmp;
    ERROR 1064 (42000): 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 '* fro
    m tmp' at line 1
    mysql> delete * from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 '* fro
    m tmp left join tmp2 on tmp.name=tmp2.name' at line 1
    mysql> delete from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 'left
    join tmp2 on tmp.name=tmp2.name' at line 1
    mysql>
    你写错了,额?这样。。我只知道我用在mysql上面是可以,难道一个oracle还比不上mysql ??
    mysql也不可以这样用啊mysql> delete * from tmp;
    ERROR 1064 (42000): 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 '* fro
    m tmp' at line 1
    mysql> delete * from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 '* fro
    m tmp left join tmp2 on tmp.name=tmp2.name' at line 1
    mysql> delete from tmp left join tmp2 on tmp.name=tmp2.name;
    ERROR 1064 (42000): 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 'left
    join tmp2 on tmp.name=tmp2.name' at line 1
    mysql>你写错了,是这样的。。delete a.* from aa as a left join bb as b  on a.b_id=b.b_id;
    delete a from aa as a left join bb as b  on a.b_id=b.b_id
    [SQL]delete a.* from aa as a left join bb as b  on a.b_id=b.b_id;
    受影响的行: 0
    时间: 0.000s[SQL]
    delete a from aa as a left join bb as b  on a.b_id=b.b_id受影响的行: 0
    时间: 0.001s

    但是受影响的行为0,只是没有显式的报错而已,删除数据只能按行删,不可能删除某一列的数据