2013-02-19 5 views
-2
SELECT nom AS Nom, id_type_produit, id_format 
FROM dbo.Produits 

난은 (id_format = 1 = 750 ml의 추천 다른 테이블에있는) 그 가치와 유형 = 1 = 와인을 보여줄 필요가 ... SQL 표시를 선택 문제

하지만 난 선택을 할 때 난 단지 내가 750 mL 및 와인 (종류와 형식의 값을 포함하는) 다른 두 테이블은 무엇

+0

를 참조 그나마 1, 2라고 볼 수? –

+0

dbo.type_produits 및 dbo_formats –

+0

테이블 구조 (3 개 테이블 모두), 예제 데이터, 예상 출력 및 지금 막 붙어있는 위치를 추가하십시오. –

답변

3
SELECT nom AS Nom, Produits.id_type_produit, type_produits.value, Produits.id_format, formats.value 
FROM dbo.Produits 
INNER JOIN dbo.type_produits ON Produits.id_type_produit = type_produits.id_type_produit 
INNER JOIN dbo.dbo_formats ON Produits.id_format = formats.id_format