고요빛물결
그누5튜닝

SQL Basics - Joins

· 2019-06-22 (토) 00:21:32 · 872

Join에 대해서는 별도로 설명..

 

제품을 Join시킨경우

select * from customer.orders
inner join Products on Orders.ProductId=Products.id;

 

as로 긴 네임을 짧게

 

select * from customer.orders as o
inner join Products as p on o.ProductId=p.id;

 

AS도 줄이자..

 

select * from customer.orders o
inner join Products p on o.ProductId=p.id;

 

전체를 볼 필요없이

select o.*, p.*, c.* from customer.orders o
inner join Products p on o.ProductId=p.id
inner join Customer c on o.CustomerID=c.id;

 

필요한 것만 표시하자..

select o.OrderDate, p.ProductName, p.Price, c.* from customer.orders o
inner join Products p on o.ProductId=p.id
inner join Customer c on o.CustomerID=c.id;

 

링크를 클릭하세요

https://youtu.be/9Pzj7Aj25lw?list=PLD20298E653A970F8&t=3030

댓글을 작성하시려면 로그인이 필요합니다.

소모임

23,243건
+
분류 제목 글쓴이 날짜 조회
해외사용자
[해외사용자]
19-06-22 조회 1,326
그누5튜닝 19-06-22 조회 1,039
그누5튜닝
[그누5튜닝]
19-06-22 조회 873
그누5튜닝 19-06-22 조회 1,094
그누5튜닝 19-06-22 조회 915
모형취미 19-06-21 조회 1,116
출산육아
[출산육아]
19-06-21 조회 836
서버관리자 19-06-21 조회 1,917
영화가좋다 19-06-21 조회 1,660
그누5튜닝 19-06-21 조회 674
그누5튜닝
[그누5튜닝]
19-06-21 조회 827
그누5튜닝
[그누5튜닝]
19-06-21 조회 771
출산육아
[출산육아]
19-06-21 조회 1,221
모형취미
[모형취미]
19-06-20 조회 1,413
서버관리자 19-06-20 조회 2,753
정치/경제/사회 19-06-20 조회 2,100
모형취미 19-06-20 조회 1,349
컴퓨터 19-06-20 조회 2,169
해외사용자 19-06-20 조회 1,048
그누5튜닝 19-06-20 조회 753
그누5튜닝 19-06-20 조회 710
그누5튜닝 19-06-20 조회 1,340
써글모
[써글모]
19-06-20 조회 945
사진 19-06-20 조회 1,851
해외사용자 19-06-20 조회 1,299
해외사용자 19-06-19 조회 1,151
사진 19-06-19 조회 2,450
해외사용자 19-06-19 조회 1,370
출산육아 19-06-19 조회 977
모형취미 19-06-19 조회 1,471