4. def Title (Focus): return H.E.R

Isuseo·2021년 1월 22일
0

SQL

목록 보기
4/4
post-thumbnail

1 Combining Tables with SQL

SELECT *
FROM orders
JOIN subscriptions
  ON orders.subscription_id = subscriptions.subscription_id;

FROM에 위치한 Table 'orders'에 Table 'subscriptions'을 합치려면
JOIN을 사용한다.

ON은 같은 각각의 Table에 Column 이 같으면 이라는 조건을 넣는다.

WhereON 에 기입한 각각의 Table에 Column 중 같은 값이 있는 부분을 기준으로 출력한다.

SELECT *
FROM orders
JOIN subscriptions
  ON orders.subscription_id = subscriptions.subscription_id
WHERE subscriptions.description = 'Fashion Magazine';
profile
A to z

0개의 댓글