当A表的classid和id等于B表的classid和id时,将b表的mtype字段拷贝到A表的buy字段。我们知道是update a inner join b on a.classid=b.classid and a.id=b.id set a.buy=b.mtype;我想问,如果不是简单的拷贝,而是首先判断mtype的值是否="出售",是则set A表的buy字段=0,否,则set A表buy字段=1
这个能用SQL语句实现吗?