Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Selecting rows by earliest date |
Mon, Aug 31 2009 12:19 PM | Permanent Link |
Mark Shapiro | Given the following table values:
status_id person_id entry_date entry_status 1 3 8/17/2009 HA 2 3 8/19/2009 HA 3 3 7/23/2009 HP 4 2 8/22/2009 HA 5 4 8/23/2009 HP how would I pull out the rows that represented the earliest date for each unique person_id plus entry_status combination? In this example, I would want to return rows 1, 3, 4, and 5. Mark Shapiro |
Mon, Aug 31 2009 3:06 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< how would I pull out the rows that represented the earliest date for each unique person_id plus entry_status combination? In this example, I would want to return rows 1, 3, 4, and 5. >> Use this query: SELECT person_id, entry_status, MIN(entry_date) AS earliest_entry_date FROM MyTable GROUP BY person_id, entry_status -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |