Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!
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;
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!