Sql Select Where Max Function In Matlab