dpxyfa4718 2015-11-26 08:39
浏览 29

MySQL多表DELETE出错

Anyone could tell me what is wrong with the following mysql query?

DELETE FROM table1 as A, table2 as B WHERE A.delivery_status = '3' AND
A.delivered_on < '2015-11-26' AND A.delivery_id = B.delivery_id

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 as A, table2 as B WHERE A.delivery_status = '3' AND A.delivered_on 'at line

I also tried < DATE('2015-11-26') because delivered_on is a datetime field, with no success.

  • 写回答

3条回答 默认 最新

  • dougou3871 2015-11-26 08:45
    关注

    try this

    DELETE FROM table1  A, table2  B WHERE A.delivery_status = '3' AND
    A.delivered_on < '2015-11-26' AND A.delivery_id = B.delivery_id
    
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法