how can optimize a query in sql server
-
hi to all how can i optimiza this query id dont want use select top(1) in nested select thanks in advance
On a first look: too many subqueries. Have a look here: How To: Optimize SQL Queries[^]. I would suggest you to ask Google with sentence: "query performance".
-
hi to all how can i optimiza this query id dont want use select top(1) in nested select thanks in advance
Consider changing
Top(1)
for Max([Time]), but with a proper indexing you shouldn't notice a to big difference.Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller
-
On a first look: too many subqueries. Have a look here: How To: Optimize SQL Queries[^]. I would suggest you to ask Google with sentence: "query performance".
Maciej Los wrote:
too many subqueries.
:thumbsup: I try to avoid subqueries; JOINs tend to work better in many situations.