troubleshooting Question

Query syntax

Avatar of soozh
soozhFlag for Sweden asked on
Microsoft SQL Server 2008SQL
4 Comments2 Solutions232 ViewsLast Modified:
I have three tables which i have joined in as below.

This query returns many rows of data and is nearly what i want.

However how would i only get the rows where dbo.Documents.doc_id is at its maxium?

SELECT        dbo.Applications.app_id, dbo.Applications.app_XMSApplicationID, dbo.Applications.app_XMSApplicationName, dbo.Applications.app_Active, 
                     dbo.DocumentData.ddt_FieldName, dbo.DocumentData.ddt_FieldValue, dbo.Documents.doc_id
FROM          dbo.Applications
                     INNER JOIN dbo.Documents ON dbo.Applications.app_XMSApplicationID = dbo.Documents.doc_ApplicationID
                     INNER JOIN dbo.DocumentData ON dbo.Documents.doc_id = dbo.DocumentData.doc_id
					 where  dbo.Applications.app_XMSApplicationID = 62
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 4 Comments.
Join the Community
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 2 Answers 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