I have wrote this SQL code but cannot find the problem with it
Select
Nodes.Caption AS ServerName,
Nodes.DeviceRole AS DeviceRole,
(
SELECT
Nodes.Caption
FROM dbo.NodeIPAddresses AS Ips
)
FROM dbo.Nodes
Nodez.Caption as Servername,
Nodez.DeviceRole as DeviceRole,
IPAddr.IPAddress as 'IP Addresses'
FROM dbo.Nodes AS Nodez
join dbo.NodeIPAddresses as IPAddr on Nodez.NodeID = IPAddr.NodeID
Well, am guessing that you just want to to list out Caption, DeviceRole and IP Address. If so, the query is a bit off. Try this:
Nodes.IP_Address AS Ips
Not sure why you were including a subselect there, for information from the same table.
I Fixed it