delete from stu_info s1 where s1.password =(select s2.password from stu_info s2 where s2.password='123456')例如这个语句  我就是执行不了吖  发生错误
ERROR 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 'where s1.password =(select s2.password from stu_info s2 where s2.password='12345' at line 1

解决方案 »

  1.   

    MS SqlServer 2000 里面这样执行是对的
      

  2.   

    不用别名:
    delete from stu_info where password =(select s2.password from stu_info s2 where s2.password='123456');或使用别名:delete s1 from stu_info s1 where s1.password =(select s2.password from stu_info s2 where s2.password='123456')
      

  3.   

    会报错
    [root@localhost:3306] ERROR 1093: You can't specify target table 'stu_info' for update in FROM clause