Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2020-10-10 19:17:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,776
Website

Re: RFC: extracting distinct values

etc wrote #326329:

which other SQL aggregate functions could be useful? Currently we have max, min, sum, avg.

Just count to add from that list, I think. Unless you reckon that’s adequately covered elsewhere. The rest are a bit esoteric and statistics-driven to be of much use, imo.

The only other outliers are:

  • group_concat() but since you have to use groups for that, we’re starting to get into seriously convoluted tag territory.
  • json_* because someone might want to pull out json-formatted content in future. But since we’re only targeting article tags here and don’t store JSON data yet, this might be overkill now.

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#22 2020-10-10 19:31:52

etc
Developer
Registered: 2010-11-11
Posts: 3,934
Website

Re: RFC: extracting distinct values

Bloke wrote #326330:

Just count to add from that list, I think. Unless you reckon that’s adequately covered elsewhere.

count is already available, but not as fields value: max(posted) is a date and can be output via <txp:posted />, but not count(posted).

group_concat() but since you have to use groups for that, we’re starting to get into seriously convoluted tag territory.

We actually already do GROUP BY, so adding group_concat() is not a problem, but I doubt of its utility.

json_* because someone might want to pull out json-formatted content in future. But since we’re only targeting article tags here and don’t store JSON data yet, this might be overkill now.

They look promising, but are available in MySQL 5.7.22+ only, do we require this?

Offline

Board footer

Powered by FluxBB