[AccessD] TOP 1 kinda thing

Mackin, Christopher CMackin at quiznos.com
Tue Nov 2 10:57:24 CST 2004


SELECT CLID, MIN(ATPID) AS MinATPID
FROM WhateverTable
GROUP BY CLID

Will take care of it.

-Chris Mackin

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Colby, John
Sent: Tuesday, November 02, 2004 9:52 AM
To: 'AccessD at DatabaseAdvisors.com'
Subject: [AccessD] TOP 1 kinda thing


I have a situation where a claim can have more than one ATP

CLID	ATPID
1	1
1	2
1	3
2	4
2	5
3	6
3	7
3	8

I need to select only the first ATPID such that the result set looks like:

CLID	ATPID
1	1
2	4
3	6

Is it possible to do this directly in SQL?

John W. Colby
The DIS Database Guy

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list