美文网首页
获取两个表差集

获取两个表差集

作者: mirse | 来源:发表于2017-12-21 17:11 被阅读0次
    取两表交集
    $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