I 다음 쿼리가이처럼 보이는 결과 세트 리턴SQL Server 쿼리 질문 (어쩌면 카운트?)
SELECT A.shipment_id
,B.box_id
,A.shipment_status
FROM shipments A
join boxes B on A.shipment_id = B.shipment_id
where A.shipment_status = 2
Group by B.box_id, A.shipment_id, A.shipment_status
:
이이 이 box_id shipment_id을 shipment_status을
101, 박스 A, 2
101, 박스 B, 2
101, 박스 C, 2
내가 대신 이런 식으로 뭔가를 반환하고 싶습니다 (102), box101, 2
(102), box102, 2
(103), boxA1, 2
(103), boxA2, 2
(선적 당 상자의 총 양을 보여주는)
은 상자 shipment_status, 카운트 shipment_id
101, 3, 2
102 2,2 012,380,073, 103, 2,
어떻게하면됩니까?
감사합니다. 당신이 당신의 제목에서 말했듯이