Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve GROUP_CONCAT Behavior – Consider GROUP BY and Support DISTINCT, ORDER BY, and SEPARATOR Options #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Javakky-pxv
Copy link
Contributor

@Javakky-pxv Javakky-pxv commented Mar 18, 2025

This pull request improves the behaviour of the GROUP_CONCAT function in php-mysql-engine to provide MySQL-compliant aggregation. The main changes include:

  • Adjusting the implementation so that if a GROUP BY clause is present, all rows are processed instead of always returning only the first row.
  • Implement the DISTINCT option to remove duplicate values.
  • Support the ORDER BY option to sort results based on the expression evaluated (in both ASC and DESC directions).
  • A SEPARATOR option has been added to allow customisation of the output delimiter (default is a comma).

@Javakky-pxv Javakky-pxv force-pushed the javakky/distinct-group-concat branch 2 times, most recently from e2b08a6 to e4ba910 Compare March 18, 2025 01:59
@Javakky-pxv Javakky-pxv changed the title fix: Support DISTINCT in GROUP_CONCAT fix: Support DISTINCT, ORDER, SEPARATOR in GROUP_CONCAT AND GROUP_CONCAT in GROUP BY Mar 18, 2025
@Javakky-pxv Javakky-pxv changed the title fix: Support DISTINCT, ORDER, SEPARATOR in GROUP_CONCAT AND GROUP_CONCAT in GROUP BY feat: Improve GROUP_CONCAT Behavior – Consider GROUP BY and Support DISTINCT, ORDER BY, and SEPARATOR Options Mar 18, 2025
@Javakky-pxv Javakky-pxv marked this pull request as ready for review March 18, 2025 10:08
@Javakky-pxv Javakky-pxv changed the base branch from master to update-workflows March 19, 2025 04:55
@Javakky-pxv Javakky-pxv changed the base branch from update-workflows to master March 19, 2025 04:56
@filisko
Copy link

filisko commented Mar 26, 2025

@Javakky-pxv great idea!

@Javakky-pxv Javakky-pxv force-pushed the javakky/distinct-group-concat branch 19 times, most recently from 512dfae to 94994d1 Compare March 28, 2025 07:19
@Javakky-pxv Javakky-pxv force-pushed the javakky/distinct-group-concat branch from 94994d1 to d165f3c Compare March 28, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants