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 5 years have passed since last update.

3つのテーブルをJOINするSQL

Last updated at Posted at 2016-12-15
SELECT t1.name AS tbl_one_name, t3.name AS tbl_three_name
  FROM tbl_one t1
  INNER JOIN tbl_two t2 ON t1.col = t2.col
  INNER JOIN tbl_three t3 ON t2.col_another = t3.col;

3つのテーブルをJOINする。tbl_oneにtbl_twoをJOINして、さらにtbl_twoにtbl_threeをJOINする。テーブル名にはエイリアスをつける。

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?