C
cliff
My data in tballnumcount query is something like this.. this query runs fast
and there are about 11462 records
sr numvalue numcount latest
1 14 4 10/26/2008
1 18 3 10/25/2008
1 23 1 10/23/2008
1 35 1 10/23/2008
1 37 1 10/23/2008
from the above 11462 records, I have written following query to select top
20 numvalue from each sr's but it is running very slow.
SELECT tballnumcount.SR, tballnumcount.NumValue, tballnumcount.Numcount,
tballnumcount.latest
FROM tballnumcount
WHERE (((tballnumcount.NumValue) In (SELECT TOP 20 numvalue
FROM tballNumCount as B
WHERE B.SR=tballnumcount.SR
ORDER BY b.Numcount desc,b.latest,b.Numvalue)))
ORDER BY tballnumcount.SR, tballnumcount.Numcount DESC ,
tballnumcount.latest DESC , tballnumcount.numvalue;
can you help me to overcome this problem
thanks
cliff
and there are about 11462 records
sr numvalue numcount latest
1 14 4 10/26/2008
1 18 3 10/25/2008
1 23 1 10/23/2008
1 35 1 10/23/2008
1 37 1 10/23/2008
from the above 11462 records, I have written following query to select top
20 numvalue from each sr's but it is running very slow.
SELECT tballnumcount.SR, tballnumcount.NumValue, tballnumcount.Numcount,
tballnumcount.latest
FROM tballnumcount
WHERE (((tballnumcount.NumValue) In (SELECT TOP 20 numvalue
FROM tballNumCount as B
WHERE B.SR=tballnumcount.SR
ORDER BY b.Numcount desc,b.latest,b.Numvalue)))
ORDER BY tballnumcount.SR, tballnumcount.Numcount DESC ,
tballnumcount.latest DESC , tballnumcount.numvalue;
can you help me to overcome this problem
thanks
cliff