Not sure why after using the MAX function I still get two results back from the following: SELECT STR(bd.ID_BB_COMPANY) AS ID_BB_COMPANY, max(bd.CUR_MKT_CAP) AS CUR_MKT_CAP, max(CONVERT(bigint,bp.TOTAL_VOTING_SHARES_VALUE)) AS TOTAL_VOTING_SHARES_VALUE, bd.CNTRY_OF_DOMICILE AS CNTRY_OF_DOMICILE FROM dbo.BloombergEquityPricingData bd LEFT JOIN BloombergEquityData bp ON bd.id_cusip = bp.id_cusip WHERE bd.EXCH_CODE = 'US' and bd.ID_BB_COMPANY = '100177' --AND bd.ID_BB_PRIM_SECURITY_FLAG = 'Y' --AND bp.ID_BB_PRIM_SECURITY_FLAG = 'Y' --AND bd.CUR_MKT_CAP IS NOT NULL group by bd.ID_BB_COMPANY,bd.CUR_MKT_CAP,bd.CNTRY_OF_DOMICILE,bp.TOTAL_VOTING_SHARES_VALUE
here are the results 100177 0 0 US 100177 43917.32 627659264 USWhy dont I just get the bottom row back when I am specifying MAX?