过滤出两列相等的行

dsf9zpds  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(306)

我有以下问题。我想让它在连接之后过滤掉类型和关系都等于“communicator”的行。我试过了 whereRaw('(type <> communicator and relationship <> communicator') 但我犯了个严重的错误。我怎样才能达到我想要的结果?
关系正在恶化 titles_to_communicators 类型在 communicators .

  1. $query = \DB::table('titles_to_communicators')
  2. ->leftJoin('communicators', 'communicators.id', '=', 'titles_to_communicators.communicator_id')
  3. ->where('relationship', '<>', 'character')
  4. ->whereIn('title_id', $childIds)
  5. ->groupBy('communicators.slug')
  6. ->limit(40);
sirbozc5

sirbozc51#

尝试
其中(type=“communicator”和relation=“communicator”)

相关问题