0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Select文覚え書き

Posted at

すんません、個人のただのメモです
現場では本読む余裕なく、というか本とか 
おけず (・_・;

inner join
outer joinのように、基準テーブルなくて
一致した行があるやつのみ抽出

なのでouter joinのように 
不一致行を得れない 
outer join は基準テーブルがある
左のテーブルを逐次読み、右のテーブルを 
フルスキャンするのが Left outer join

逆がRight outer join
両方から検索するのが full join

union
select文の結果を合成させる

select num,name from tableA
union
select '0' as num, '名前0' as name
order by num
limit 4

num name
0 名前0 下のselect文
1 名前1 上のselect文
2 名前2 上
3 名前3 上

上下、二つのselect結果を合成させる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?