1. 程式人生 > >mysql 關聯查詢 修改 ssm mabits

mysql 關聯查詢 修改 ssm mabits

//關聯查詢   紅色是表 藍色是別名 綠色是欄位列

//查詢兩個表所有

select * from salecustomerssc inner join saleproduct   spon sc.oId =sp.spOIdwhere sc.del_Flg = #{del_Flg}

   //修改兩個表的內容

       <update id="SaleCustomersAndProductDel" >

        UPDATE salecustomers,saleproduct

        SET salecustomers.DEL_FLG=#{del_Flg},saleproduct.DEL_FLG
=#{del_Flg}
        WHERE salecustomers.OID=saleproduct.SPOID and salecustomers.OID=#{oId};
</update>