获取两个表差集
2017-12-21 本文已影响0人
mirse
取两表交集
$map['b.field'] = array('exp', 'is not null');
取两表差值
$map['b.field'] = array('exp', 'is null');
$data = M('a')
->join('b ON b.id = a.id')
->where($map)
->select();
$map['b.field'] = array('exp', 'is not null');
$map['b.field'] = array('exp', 'is null');
$data = M('a')
->join('b ON b.id = a.id')
->where($map)
->select();