在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’;