美文网首页
left join on and和left join on wh

left join on and和left join on wh

作者: justlinzhihe | 来源:发表于2018-02-27 14:16 被阅读0次
    person表
    infos表

    sql1select person.name,infos.age from person LEFT JOIN infos on person.id = infos.person_id and infos.age=11

    image.png

    sql2select person.name,infos.age from person LEFT JOIN infos on person.id = infos.person_id where infos.age=11

    image.png

    left join on and这种写法会返回左表的所有数据
    left join on where 会对数据进行筛选

    相关文章

      网友评论

          本文标题:left join on and和left join on wh

          本文链接:https://www.haomeiwen.com/subject/dvzpxftx.html