[AccessD] TOP 1 kinda thing

Colby, John JColby at dispec.com
Tue Nov 2 11:12:00 CST 2004


Thanks, that was what I was looking for.  

John W. Colby
The DIS Database Guy


-----Original Message-----
From: Mackin, Christopher [mailto:CMackin at quiznos.com]
Sent: Tuesday, November 02, 2004 11:57 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] TOP 1 kinda thing


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
-- 
_______________________________________________
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