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是任意定义的值

posted on 2016-08-30 20:58  wonder2636  阅读(6702)  评论(0编辑  收藏  举报

导航