troubleshooting Question

Query help

Avatar of dgrafx
dgrafxFlag for United States of America asked on
Microsoft SQL Server
4 Comments1 Solution50 ViewsLast Modified:
I have table_one
id(int), name(varchar)

example recordset from table_one
1000 Testone
1001 Testtwo
1002 Testthree

joined on table_two
id(int), sdate(date), edate(date)

example recordset from table_two
1000 01/12/2019     02/15/2019
1000 02/16/2019     03/15/2019
1000 03/16/2019     04/19/2019
1002 01/16/2019     02/13/2019
1002 02/14/2019     04/17/2019

This is a one to many relationship with table_one being primary
I want to select only one row from table_two that has the latest edate value

So result set of desired query would be

1000 Testone 03/16/2019     04/19/2019
1002 Testthree   02/14/2019     04/17/2019

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros