Mysql query with Left Join is too very slow

后端 未结 6 1166
萌比男神i
萌比男神i 2021-02-13 16:09

Query:

   select `r`.`id` as `id` 
     from `tbl_rls` as `r` 
left join `tblc_comment_manager` as `cm` on `cm`.`rlsc_id` != `r`.`id`

Both tabl

6条回答
  •  忘了有多久
    2021-02-13 16:45

    What do you want to select?

    Use this query if you want to find tbl_rls records that haven't matching records in other table

    select `r`.`id`
    from `tbl_rls` as `r` 
    left join `tblc_comment_manager` as `cm` 
        on  `cm`.`rlsc_id`=`r`.`id
    where `cm`.`rlsc_id` IS NULL
    

提交回复
热议问题