So I have these columns from performing an aggregate function: Table
SELECT MachineName,
(100*((1)
-((
sum(CASE p1.CounterName
WHEN 'Available Bytes' THEN
p2.CounterValue
ELSE
0
END)
/NULLIF(
(sum(CASE p1.CounterName
WHEN 'Available Bytes' THEN
p2.CounterValue
ELSE
0
END)
+
sum(CASE p1.CounterName
WHEN 'Committed Bytes' THEN
p2.CounterValue
ELSE
0
END)
+
sum(CASE p1.CounterName
WHEN 'Modified Page List Bytes' THEN
p2.CounterValue
ELSE
0
END)),0) )))) As Memory
I only want Memory > 75 that needs to be selected but I'm not familiar enough with SQL and aggregate function so I'm not sure if this is possible.
You can try using subquery like below -
select * from
(
SELECT MachineName,
(100*((1)
-((
sum(CASE p1.CounterName
WHEN 'Available Bytes' THEN
p2.CounterValue
ELSE
0
END)
/NULLIF(
(sum(CASE p1.CounterName
WHEN 'Available Bytes' THEN
p2.CounterValue
ELSE
0
END)
+
sum(CASE p1.CounterName
WHEN 'Committed Bytes' THEN
p2.CounterValue
ELSE
0
END)
+
sum(CASE p1.CounterName
WHEN 'Modified Page List Bytes' THEN
p2.CounterValue
ELSE
0
END)),0) )))) As Memory
)A where memory>75
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.