From a performance perspective is it better to use SELECT MAX(columnA) FROM table1 or SELECT TOP 1 columnA FROM table1 ORDER BY columnA?
From a performance perspective is it better to use SELECT MAX(columnA) FROM table1 or SELECT TOP 1 columnA FROM table1 ORDER BY columnA?
The best way to determine this would be to analyze the execution plan of each statement in Query Analyzer. It is also important to note that the performance of each query will be heavily dependent on the size of table1. What I would do is place both queries in the same query window and run them at the same time, then view the execution plans to see the cost of each and what each query is doing.
The answer will also depend on whether or not there is an index built on columnA.
In a quick example that I ran, the SELECT MAX(columnA) FROM table1 was significantly faster because the system aggregate function (MAX) was substantially better performing than the sort step but I would make sure that you test it on your own end first. If nothing else it will be a good excersize in query tuning and reading execution plans.