How do I use Group BY to display only one record in CR? I have narrowed down the records I want to use, but because of joining the LEFT JOIN tables in CR, it duplicates the records. I only need to display one and I don't know how to use CR Grouping.
THIS my record selection:
{TraElem.TrE_TypTwr} in [1, 2, 3] OR ({TraElem.TrE_TypTwr} = 4 AND {Atrybuty.Atr_Wartosc} LIKE 'Tak' AND {Atrybuty.Atr_atkid} = 15)
W MSSQL :
join cdn.twrkarty on TrE_TwrTyp=Twr_GIDTyp and TrE_TwrNumer=Twr_GIDNumer
JOIN CDN.atrybuty on Atr_ObiTyp=Twr_GIDTyp AND Atr_ObiNumer=Twr_GIDNumer
WHERE (TrE_GIDTyp=2037 AND TrE_GIDNumer=38012)
AND
(
TrE_TypTwr in (1, 2, 3)
OR
(
TrE_TypTwr=4
AND
(
SELECT Atr_Wartosc FROM CDN.Atrybuty WHERE Atr_ObiTyp=Twr_GIDTyp AND Atr_ObiNumer=Twr_GIDNumer AND Atr_AtkId=15
) like 'Tak'
)
)
CodePudding user response:
Name_1
Name_1
Name_2
Name_2
Name_2
Name_3
Name_3
Name_3
And he wants this:
Name_1
Name_2
Name_3
CodePudding user response:
okay, topic to close. I found myself how to do it in CR.