많은 필드가 결과 행에 중복 될 수 있기 때문에 왜 join 문이 인기가 있는지 궁금합니다.왜 join 문을 사용합니까?
Supplier(id, name, address)
Product(id, name, detail)
Product_Supplier(id, productId, supplierId, quantity)
SELECT Product.*,
Product_Supplier.supplierId,
Product_Supplier.quantity
FROM Product
INNER JOIN Product_Supplier ON Product.id = Product_Supplier.productId
결과는 다음과 같이 보일 수 있습니다 : product.detail
가 큰 텍스트가
Product.id Product.name Product.detail Product_Supplier.supplierId Product_Supplier.quantity
1 'Product 1' 'bla bla' 100 20
1 'Product 1' 'bla bla' 101 30
1 'Product 1' 'bla bla' 102 20
1 'Product 2' 'bla bla' 100 120
그래서이라면 성능은 오른쪽 둔화 될 것인가? 그것이 사실이라면 왜 join statement가 인기가 있습니까?
내가 왜 문에 가입 궁금해 * *이 매우 인기가있다? 트렌드가 있습니까? – Raptor
가능한 복제 [this] (http://stackoverflow.com/questions/2241991/in-mysql-queries-why-use-join-instead-of-where) –
별칭을 사용하여 출력 열 이름의 이름을 바꿉니다. – Bohemian