多表查询

多表查询:

  连接查询:
    内连接 inner join

    select *  

    from table A,table B 

    where tableA.id = tableB .table_id

    select *

    from tableB inner join tableA 

    on tableB.tableA_id = tableB.id

    外连接 left join  right join

  

 select *

    from tableB left join tableA 

    on tableB.tableA_id = tableB.id

   

原文地址:https://www.cnblogs.com/Syue/p/9514500.html