Skip to content

Commit

Permalink
Update QUERIES.md
Browse files Browse the repository at this point in the history
Fix @toddboom's top query
  • Loading branch information
pauldix committed Dec 9, 2014
1 parent 4f0fb3d commit ae0b6b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions QUERIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

## Having

SELECT COUNT(value) FROM some_series GROUP BY TIME(5m) HAVING COUNT(value) > 23
```sql
SELECT COUNT(value) FROM some_series GROUP BY TIME(5m) HAVING COUNT(value) > 23

SELECT * FROM cpu GROUP BY TIME(1h), host HAVING TOP(value, 10) WHERE time > NOW()
SELECT top(10, value, host), host FROM cpu WHERE time > now() - 1h

SELECT MAX(value) AS max_value, host FROM cpu GROUP BY TIME(1h), host HAVING TOP(max_value, 13)
SELECT MAX(value) AS max_value, host FROM cpu GROUP BY TIME(1h), host HAVING TOP(max_value, 13)
```

## Group By

Expand Down

0 comments on commit ae0b6b5

Please sign in to comment.