WITH categories(category, category_range) AS (
SELECT n::text || ' to ' || (n + 0.1000::integer)::text, int4range(n, (n + 0.1000::integer)), n as lower, (n + 0.1000::integer) as upper
FROM generate_series(166.0000::integer, 173.0000::integer, 0.1000::integer) as a(n)
WHERE n < 173.0000
)
SELECT c.category, lower(c.category_range)::integer, upper(c.category_range)::integer, COALESCE(r.count_column, 0) as count_column
FROM categories c
LEFT JOIN (
SELECT category, COUNT(DISTINCT tbl_analysis_entities.analysis_entity_id) AS count_column
FROM tbl_analysis_entity_ages
JOIN categories
ON categories.category_range && age_range::int4range
INNER JOIN tbl_analysis_entities
ON tbl_analysis_entities."analysis_entity_id" = tbl_analysis_entity_ages."analysis_entity_id"
WHERE TRUE
AND int4range(166, 173, '[]') && age_range
GROUP BY category
) AS r
ON r.category = c.category
ORDER BY c.category_range;
I intend to use the analysis entity ages facet as the basis of the general purpose timeline, and for that we need to be able to select small timespans.
This request against /facets/load:
Results in: "ERROR: step size cannot equal zero".
With this being the generated SQL:
I intend to use the analysis entity ages facet as the basis of the general purpose timeline, and for that we need to be able to select small timespans.