注:本操作僅在Idea中進行(并未在MySQL workbench中哦)
join内連接配接(inner)概述:
基于連接配接謂詞将兩張表組合在一起,進而産生新的一張表(類似與操作,取其相同部分的屬性)。
1、首先,你要有兩個表:
表1:people
表2:students
2、然後,進行sql語句操作
select students.s_name,students.s_age,people.p_sex
from students
inner join people
on students.s_name=people.p_name
order by students.s_name;
3、結果,當當當~
如何連接配接mysql資料庫?請點選連接配接