Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.
with p as ( select TR.[Generic Code], TR.NDC, TR.[Drug Name], Sum(cast(TR.[Qty] as int)) as Qty from vw_Test3 TR Group By TR.[Generic Code], TR.NDC,TR.[Drug Name] ) select x.[Generic Code], x.NDC, x.[Drug Name], y.Qty from ( select p.*, row_number() over (partition by [Generic Code] order by Qty desc) rn from p ) x left join ( select [Generic Code], sum(cast(Qty as int)) Qty from p group by [Generic Code] ) y on x.[Generic Code]=y.[Generic Code] where rn=1;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.