delete t1 from mycursor1 t1 join mycursor2 on t1.field1>5 and mycursor2.field1=t1.field1, mycursor3 where mycursor2.field1= mycursor3.field1
此条代码如何来理介?
t1 join mycursor2 on t1.field1>5 and mycursor2.field1=t1.field1, mycursor3 where mycursor2.field1= mycursor3.field1
红色的表示T1与mycursor2 二表内連,条件为t1.field1>5 and mycursor2.field1=t1.field1
而兰色的mycursor3 where mycursor2.field1= mycursor3.field1与前面連接条件有何关系呢?
我在手机上看的,就不多打文字了。在数据未知的情况下,我凭语法和命令本身的含义,觉得语句可以简化成:DELETE MyCursor1 FROM MyCursor3 WHERE MyCursor1.Field1>5 AND MyCursor1.Field1=MyCursor3.Field1。这下应该可以理解了吧?
DELETE 用连接是多余的。
可改成这样:
DELETE mycursor1 from mycursor2,mycursor3 where mycursor1.field1>5 and mycursor1.field1=mycursor2.field1 AND mycursor2.field1= mycursor3.field1