Check sql results are array in median query.