Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have written below query but it is taking time ,please any one can rewrite the query to get result fast.


I want to remove the post
Posted
Updated 12-Oct-15 22:41pm
v2
Comments
Maciej Los 1-Dec-14 9:01am    
Reduce the count of subqueries!

There is few ways to improve performance of sql query. See:
http://www.infoworld.com/article/2628420/database/7-performance-tips-for-faster-sql-queries.html[^]
http://www.developer.com/db/10-ways-to-improve-sql-query-performance.html[^]

At the first look, reducing the numbers of subqueries in WHERE statement might help.
 
Share this answer
 
Your query full of sub-queries, even nested.
Remove those sub-queries and replace them with LEFT JOIN (or INNER JOIN where fits better), that will help you...
 
Share this answer
 
Comments
Member 10256268 1-Dec-14 23:22pm    
Can you give me query by removing sub query and apply left join or inner join for above query.
Kornfeld Eliyahu Peter 2-Dec-14 2:09am    
Not really. I do not know your schema, do not know your request, so it is hard to me to directly help you.
You should use Google to find samples (and there are a lot) and implement them for your case...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900