Query returning multiple rows
- From: "Jig Bhakta" <JigBhakta@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Aug 2005 10:30:02 -0700
Hi,
I have a query that returns back rows that have multiple entries for a given
UniqueID. I want the query to be expanded so that it then only returns 1 of
the multiple rows based on the maximum date. Thefore, my return set looks
like this:
UniqueID Name Date
---------------------------------
123 ABC 20041104
123 ABC 20041105
456 ABC 20031221
456 ABC 20031222
789 ABC 20050430
789 ABC 20050429
The query is this:
select *
from table A
where (select count(*) from table where UniqueID = A.UniqueID) > 1
.
- Follow-Ups:
- Re: Query returning multiple rows
- From: Hugo Kornelis
- Re: Query returning multiple rows
- Prev by Date: Re: TABLE Joins Problem
- Next by Date: Re: TABLE Joins Problem
- Previous by thread: TABLE Joins Problem
- Next by thread: Re: Query returning multiple rows
- Index(es):
Relevant Pages
|
|