Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 show second result for multiple records - MSSQL200

Author  Topic 

chenks
Starting Member

1 Post

Posted - 2013-08-30 : 04:25:32
I've got a query that displays the second result for one customer. what i now need to do is show the second result for each customer in a particular list (for example 20 different customers G/1931, G/1932, G/1933 etc etc).

how would i do this? MS SQL2000 via SSMS 2005

current query for 1 customer is

SELECT TOP 1 link_to_client, call_ref
FROM
(
SELECT TOP 2 link_to_client, call_ref
FROM calls WITH (NOLOCK)
WHERE link_to_client IN ('G/1931')
AND call_type = 'PM'
ORDER BY call_ref DESC
) x
ORDER BY call_ref


thanks
   

- Advertisement -