多表关联 本文为您介绍SELECT语法中多表关联的使用方法。 内连接 plaintext teledb select from teledbpg inner join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 3 pg 3 pg (1 row) 左外连接 plaintext teledb select from teledbpg left join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 1 hello,pgxc 2 TELEDB 3 pg 3 pg 4 (5 rows) 右外连接 plaintext teledb select from teledbpg right join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 5 test 3 pg 3 pg (2 rows) 全连接 plaintext teledb select from teledbpg full join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 3 pg 3 pg 4 1 hello,pgxc 2 TELEDB 5 test (6 rows)
来自: