Template/Query Grouping

Im sure you’ve heard this before, but i really think silverbullet needs a group by statement in the query language. Im primarily using my silverbullet as a knowledge base and im breaking topics down by frontmatter and it saddens me that there is no easy way to group.

Other than this, im loving silverbullet. Thank you zef & community for all your hard work. If i had the technical knowledge to implement this myself, i would.

I don’t really understand what you are talking about. What do you mean with grouping, and what do you mean with “a function we can use.”

In standard SQL, I would call it a group by statement. As far as function, im probably using the incorrect term here. Ill just take that bit out of the post in regards to the templates since we can just do a group by statement via query in the template itself if this feature were added.

group by would also need some aggregate functions like sum etc. to be really useful.

For example here’s standard SQL which groups rows by name and each result row has sum of values for each name:

SELECT name, SUM(value)
FROM some_table
GROUP BY name
1 Like

Ah… now I get it. Yes, aggregation support in the query language would indeed be nice.

3 Likes