Grouping and Aggregating Records
Options
Is there a way to create this query using Xano? I don't see a way to use "HAVING"
SELECT user_id, COUNT(*)
FROM comments
WHERE photo_id <= 50
GROUP BY user_id
HAVING COUNT(*) > 20;
SELECT user_id, COUNT(*)
FROM comments
WHERE photo_id <= 50
GROUP BY user_id
HAVING COUNT(*) > 20;
Comments
-
AFAIK you are correct - there is support for aggregation (under "output") but not for aggregate filtering ("having").
The solution I use is to prune the result set in the function stack and then return the pruned list. Since aggregation has already seriously cut down on the resultset count, the performance is not seriously impaired compared to just doing it in the SQL for most use cases.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback