Where clause for only one table in a left join

前端 未结 4 1466
难免孤独
难免孤独 2020-12-21 06:07

I have two tables, the first is \'actions\' which has columns \'id\' and \'actionname\', the second is \'completedactions\' which has \'userid\' and \'actionid\'. They look

4条回答
  •  忘掉有多难
    2020-12-21 06:29

    select * from actions

    left outer join completedactions on ( completedactions.actionid = actions.id and completedactions.userid=1 )

提交回复
热议问题