Hereby I send the query causing all the performance troubles. When I leave out the first SUM(CASE ... attribute, the query has finished after 6 seconds. With the sum attribute...
Eric, thanks for your reply. I will hand over your suggestions to our sql dba. This afternoon I did some more research on the query and I found that 2...