Link to home
Start Free TrialLog in
Avatar of deloused
deloused

asked on

Select Row Where Column 1 is Unique

I need help with a select statement.  I would like to have something like the SQL below, except only return values where the Project.JobNumber is unique.  I would like also to take the last ProjectStatus.StatusDate as the tie breaker.  Please let me know how this can be done.  Thanks!
SELECT        Project.JobNumber, ProjectStatus.StatusType, ProjectStatus.StatusDate, ProjectStatus.AssignDate, Project.ID, StatusType.Description
FROM            Project INNER JOIN
                         ProjectStatus ON Project.ID = ProjectStatus.ProjectID INNER JOIN
                         StatusType ON Project.Status = StatusType.ID AND ProjectStatus.StatusType = StatusType.ID
ORDER BY Project.JobNumber, ProjectStatus.StatusDate

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deloused
deloused

ASKER

Thank you!  Worked great
You are welcome!