R
Randal
I am using the following query to get the top 10 for multiple IDs. This
query works very quickly as a select query with no sorting. If you sort it
in the query or in report or turn it into a make table query, it slows to a
crawl.
Does anyone know how to speed this up? I need to display the amounts sorted
in descending order in a report.
SELECT
[Your Table].[ID],
[Your Table].[AMT1]
WHERE
[Your Table].[AMT1] IN
(SELECT TOP 10
[Self].[AMT1]
FROM
[Your Table] AS [Self]
WHERE
[Self].[ID] = [Your Table].[ID])
query works very quickly as a select query with no sorting. If you sort it
in the query or in report or turn it into a make table query, it slows to a
crawl.
Does anyone know how to speed this up? I need to display the amounts sorted
in descending order in a report.
SELECT
[Your Table].[ID],
[Your Table].[AMT1]
WHERE
[Your Table].[AMT1] IN
(SELECT TOP 10
[Self].[AMT1]
FROM
[Your Table] AS [Self]
WHERE
[Self].[ID] = [Your Table].[ID])