โดย bondham » 20/11/2020 11:25 am
ผมใช้ DISTICT แต่มันไม่ออกครับ คือผมต้องการให้มันเอาข้อมูลที่ซ้ำในคอลัม Description ออกครับ
SELECT aa.[No_]
,aa.[Sell-to Customer No_]
,aa.[Bill-to Name]
,bb.[Size]
,cc.No_
,distinct cc.Description
FROM [dbo].[PRE_$Sales Header] aa
left join [dbo].[PRE_$Item Spec] bb
on aa.[No_] = bb.[Sales Quote No_]
left join [dbo].[PRE_$Sales Line] cc
on aa.[No_] = cc.[Document No_]
where aa.[Document Type] = 0 and aa.[Sell-to Customer No_] = 'C100073'
ผมใช้ DISTICT แต่มันไม่ออกครับ คือผมต้องการให้มันเอาข้อมูลที่ซ้ำในคอลัม Description ออกครับ
[quote]SELECT aa.[No_]
,aa.[Sell-to Customer No_]
,aa.[Bill-to Name]
,bb.[Size]
,cc.No_
,distinct cc.Description
FROM [dbo].[PRE_$Sales Header] aa
left join [dbo].[PRE_$Item Spec] bb
on aa.[No_] = bb.[Sales Quote No_]
left join [dbo].[PRE_$Sales Line] cc
on aa.[No_] = cc.[Document No_]
where aa.[Document Type] = 0 and aa.[Sell-to Customer No_] = 'C100073'[/quote]