Sha256: c8322a3a9efde9217dd4bf0449b673ee91052a1ba53e46fb392d7029fcd7eba6

Contents?: true

Size: 463 Bytes

Versions: 5

Compression:

Stored size: 463 Bytes

Contents

// vim: ft=javascript
// Return the top three breweries based on their numbers of offered beers. Also
// illustrate the use of multiple aggregate functions to compute various
// alcohol content statistics for their beers
{
  "statement": "SELECT bw.name, COUNT(*) AS num_beers, AVG(br.abv) AS abv_avg, MIN(br.abv) AS abv_min, MAX(br.abv) AS abv_max FROM breweries bw, beers br WHERE br.brewery_id = meta(bw).id GROUP BY bw.name ORDER BY num_beers DESC LIMIT 3"
}

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mt-libcouchbase-1.4.03 ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json
mt-libcouchbase-1.4.02 ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json
mt-libcouchbase-1.4.01 ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json
mt-libcouchbase-1.4.0 ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json
libcouchbase-1.3.2 ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json