取两表交集
$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();
本文标题:获取两个表差集
本文链接:https://www.haomeiwen.com/subject/qxwawxtx.html
网友评论