If I have SQL something like the following
(
SELECT Something.SomethingId, [Surname] + ', ' + [FirstName] AS MyPerson
FROM Blah Blah Blah
WHERE (((Table.SomeId)=1234))
UNION
SELECT Something_1.SomethingId, [Surname] + ', ' + [FirstName] AS MyPerson
FROM Blah Blah Blah
WHERE (((Table.SomeId)=1234))
)
ORDER BY SomethingId
Let's say it returns 2 records as it stands...
SomethingId MyPerson
1 John Smith
99 Able Andy
Is there somthing else I can add to the SQL so it will return only one record with the name of MyPerson related to the Maximum SomethingId?
(
SELECT Something.SomethingId, [Surname] + ', ' + [FirstName] AS MyPerson
FROM Blah Blah Blah
WHERE (((Table.SomeId)=1234))
UNION
SELECT Something_1.SomethingId, [Surname] + ', ' + [FirstName] AS MyPerson
FROM Blah Blah Blah
WHERE (((Table.SomeId)=1234))
)
ORDER BY SomethingId
Let's say it returns 2 records as it stands...
SomethingId MyPerson
1 John Smith
99 Able Andy
Is there somthing else I can add to the SQL so it will return only one record with the name of MyPerson related to the Maximum SomethingId?