0
SQL 문에서 중복 된 내용을 제거하려고합니다. 고객 ID, 이름 및 성 customerID로 그룹화 할 수 있고 중복 된 고객 ID 양식, 이름 및 성을 제거 할 수 있습니다. 최종 출력그룹 고객 정보 연락처
SELECT customers.customerid,
customers.title,
customers.firstname,
customers.lastname,
customers.postion,
company.companyname,
(SELECT label.labelcontacttype
FROM label
WHERE label.labelcontacttypeid =
customer_contacts.labelcontacttypeid)AS
contactType,
customer_contacts.contactdetails,
customer_contacts.status,
customer_contacts.notes
FROM customers
INNER JOIN customer_company
ON customers.customerid = customer_company.customerid
INNER JOIN company
ON customer_company.companyid = company.companyid
INNER JOIN customer_contacts
ON customers.customerid = customer_contacts.customerid
전류 출력
15 Mr Mike Smith Web Developer compudata Email [email protected] 1 dvv
15 Mr Mike Smith Web Developer compudata Phone 111-111-1111 1 ex:2222
무엇이 질문입니까? 입력은 무엇입니까? 무슨 일 이니? – LittleBobbyTables
dups의 이유는 'contacttype'이 다른 값과 다르다는 것입니다. 어느 값을 표시하고 싶습니까? 또는 데이터를 어떻게 표시 하시겠습니까? – Taryn