mysql語法 join on 表示什麼

2021-10-22 04:42:21 字數 323 閱讀 9160

今天在寫sql語句的時候遇到了join on 這個東西表示的是外連線還是內連線呢?想要驗證其實並不難

查詢出來的資料量

–129

select count(1) from t_budget a left join t_budget_item b on a.budget_id =b.budget_id

–117

select count(1) from t_budget a join t_budget_item b on a.budget_id =b.budget_id

由此可見,join on 表示的是內連線,其效果相當於inner join

MySql級聯查詢join on的例項

select distinct u.name from eclass user as u join eclass testrecord as t on u.userid t.userid where t.testid in 220,256,257 這個是三張表的級聯查詢,和下面的差不多關鍵字用的也是...

mysql 語法 mysql的刪除語法

刪除資料庫 drop database test 刪除表 drop table ifexists test 刪除表資料 delete from test where id 1 不會減少表或索引所占用的空,可以加where條件,可以進行rollback回滾 truncate table test 執行...

mysql 語法入門 mysql基礎語法

1 dml 增刪改查 1 select 獲取資料 select from 表名 where 條件 2 update 更新資料 update 表名 set 欄位名 值,欄位名 值 where 條件 3 delete 刪除資料 delete from 表名 where 條件 4 insert into ...