SELECT TOP from CTE based on subtraction of 2 column group by another
I have data which is the results from a bunch of CTE and a query and this is where I am at. Query (not including all previous CTE tables): SELECT CustomerCode, SUBSTRING(SerialNumber, CHARINDEX(‘-‘, SerialNumber) + 1, 6) SerialNumber, nbServer, ISNULL(nbImaging, 0) nbImaging FROM Magic WHERE CS_MagicNUmber <> I_MagicNumber OR CS_MagicNUmber IS NULL OR I_MagicNUmber IS… Read More SELECT TOP from CTE based on subtraction of 2 column group by another