For some SQL statements with multiple Max() functions in the select list and nothing in the Where clause, we have different methods to create new indexes to improve the SQL speed.
Here is an example SQL, it is to retrieve the maximum name and age from the employee table.
select max(emp_name), max(emp_age)
from employee
The following is the query plan that takes 9.27 seconds.
The SQL cannot be tuned by SQL syntax...
How to build indexes for multiple Max() functions for SQL Server?
Here is an example SQL, it is to retrieve the maximum name and age from the employee table.
select max(emp_name), max(emp_age)
from employee
The following is the query plan that takes 9.27 seconds.
![[IMG]](http://live.staticflickr.com/65535/51838449322_ee22ba09ec_b.jpg)
The SQL cannot be tuned by SQL syntax...
How to build indexes for multiple Max() functions for SQL Server?