Bug #7753 A SPLIT function in MySQL?!?
Submitted: 9 Jan 2005 20:57 Modified: 21 Feb 2006 12:49
Reporter: Are you mortal Then prepare to die. Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:next OS:Any (all)
Assigned to: CPU Architecture:Any

[9 Jan 2005 20:57] Are you mortal Then prepare to die.
It would be really great if there were a SPLIT function in MySQL (kind of a 'mirror' function to the GROUP_CONCAT function).

The split would generate one row per 'chunk' of data split.

For example,

1) Example data

select * from T1;
x y
a 1
a 2
a 3
b 1
b 2
b 3

2) Show existing function (4.1 or UDF)

create T2 select x, group_concat(y,":") as z from T1;

select * from T2
x z
a 1:2:3
b 1:2:3

3) How new SPLIT function should work

select x, split(z, ":") as y_again from T2;

x y_again
a 1
a 2
a 3
b 1
b 2
b 3

This would be really cool (and not too hard?)

How to repeat:
Think 'mirror function'

Suggested fix:
Design a UDF or implement a new function.
[21 Feb 2006 11:18] Valeriy Kravchuk
Thank you for a feature request. Yes, it will be "cool" to have a function like this, but you can write the UDF yourself if it is really needed for your applications. I am not sure that it will be added as a builtin function in any foreseeable future, though.
[21 Feb 2006 12:49] Are you mortal Then prepare to die.
Where is the MySQL UDF Community page?

I think MySQL should try to centralise the UDF developers of the world in a 'non official' set of pages (or at least a mailing list). Please do this now. I don't want to write a UDF until I know that it will reach the maximum possible number of people via a centralised UDF repo.

[29 Apr 2006 16:05] Sergei Golubchik
Not MyPan but MySQLForge, but you're right about the rest.