获取两个表差集

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();
上一篇 下一篇

猜你喜欢

热点阅读