当前位置:Gxlcms > 数据库问题 > 数据库(连接)

数据库(连接)

时间:2021-07-01 10:21:17 帮助过:2人阅读

连接:

  为什么需要连接?:因为我们需要的数据在不同的表中

内连接:

  select 列A from 表A inner join 表B on 条件1=条件2

   在内连接中可以省去 inner 

   注:on 必须和join 一起出现  他没有单独存在的意义

外连接:

  left join :左连接 

  right join: 右连接

  full join :全外连接  注:在mysql中 并不支持

自连接:

  select 列名 from 表A jion 表A on 条件

数据库(连接)

标签:

人气教程排行