mysql 两个表数据做对比

表a 和 表b中对比一个字段,sql如下:

select if(a.sku_fee=b.sku_fee,0,1) as ss from bill_info a,bill_info b where  a.multi_channel_order_no = b.multi_channel_order_no

如果相同,ss返回0,如果不同,结果返回1,其中0和1是任意定义的值

原文地址:https://www.cnblogs.com/wonder2636/p/5823602.html