var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Get the Row which has Max value of the field
I want to get a field value in the row, which has max value of another field in the same table
I have done with the below query. I want to know is there any other better way of doing it becuase it is taking longer time.
Thanks for your help
WHERE Field2 = ( SELECT MAX(field2)
That shouldn't take too long to process. How many rows, and do you have an index on Field2?
I have about 200k records. I have index (non-clustered )on field2. More over it is taking about 7 sec to run the above query
...and of those 200K records, how many are typically being returned in the result set? It may take several seconds to display the result set.
Have you tried viewing the query plan?