The following query will return the Coordinators that have connected to the database and the full build number:
Select Topology.Server.ServerName, System.Repository.VerMajor, System.Repository.VerMinor, System.Repository.VerBuild, System.Repository.VerRevision from Topology.Server
Inner Join System.Repository
On Topology.Server.ServerID = System.Repository.RepositoryID
This query will return the agents and their build numbers:
Select Topology.Server.ServerName, System.Agent.VerMajor, System.Agent.VerMinor , System.Agent.VerBuild, System.Agent.VerRevision from Topology.Server
Inner Join System.Agent
On Topology.Server.ServerID = System.Agent.AgentID