I'm new to SQL. However I been tasked with getting data for device and replacing the name for something easier for upper management. This is what I am trying you use an I keep getting an error.
Select
X.[Production Mine Sites],
X.[24Hr Avail],
Y.[7Day Avail],
Z.[30Day Avail]
FROM(
SELECT
--Caption as Node,
--Location,
CASE
WHEN IP_Address LIKE 'xx.xx.xx.xx'
THEN 'Friend'
WHEN IP_Address LIKE 'yy.yy.yy.yy'
THEN 'Engineer'
WHEN IP_Address LIKE 'zz.zz.zz.zz''
THEN 'End User'
AS [Production Mine Sites],
Round(AVG(Availability),3) as [24Hr Avail]
FROM
Nodes INNER JOIN DailyNodeAvailability as NAV ON (Nodes.NodeID = NAV.NodeID)
WHERE
(NAV.datetime > getdate()-1)
AND
(ip_address in('xx.xx.xx.xx', 'yy.yy.yy.yy', 'zz.zz.zz.zz'))
GROUP BY
--Caption
--,Location,
CASE
WHEN IP_Address LIKE 'xx.xx.xx.xx'
THEN 'Friend'
WHEN IP_Address LIKE 'yy.yy.yy.yy'
THEN 'Engineer'
WHEN IP_Address LIKE 'zz.zz.zz.zz''
THEN 'End User'
END
) AS X
there is of course more but it is the same. Do I need to provide that so it can be look at also?