zoukankan      html  css  js  c++  java
  • mysql delete语句不能用别名

    在mysql数据库里运行delete语句

     
    delete from tb_js_ryxx t where t.sydw_id='402880006add1e93016ade0c1d060029' and  t.id =‘123’; 

    发现会报错:

     [Err] 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 't where t.sydw_id='402880006add1e93016ade0c1d060029' and  t.id=‘123’ ’

    网上说mysql数据库delete语句不能用别名

    改成这样即可

    delete from tb_js_ryxx where sydw_id='402880006add1e93016ade0c1d060029' and  id =‘123’; 

    想用别名也可以

    要在 delete 和 from 中间加上别名

    delete t from tb_js_ryxx t where t.sydw_id='402880006add1e93016ade0c1d060029' and  t.id =‘123’; 
  • 相关阅读:
    Ubuntu下 实现Linux与Windows的互相复制与粘贴
    bzoj2426
    bzoj1835
    bzoj1197
    bzoj1049
    bzoj2893
    bzoj1820
    bzoj1819
    bzoj1455
    bzoj3689
  • 原文地址:https://www.cnblogs.com/xc-chejj/p/11007764.html
Copyright © 2011-2022 走看看