Details
-
Type:
Task
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Hi!
Sorry I couldn't select here issue type 'New Feature'.
Here a lot of useless string functions are not clear even in some cases it is necessary for example MAKE_SET, SPACE or EXPORT_SET, but none of which are allowed to make a delimited string table.
SELECT * FROM seq_1_to_10 WHERE FIND_IN_SET (seq, '5,6,10')
makes the identity thing as
SELECT * FROM seq_1_to_10 WHERE seq IN (1,6,10)
the same can be obtained as
SELECT * FROM seq_1_to_10 WHERE seq IN (SELECT 1 UNION ALL SELECT 6 UNION ALL SELECT 10)
If the SQL statement would be that converted a delimited string into a table as I show below would be better
SELECT * FROM seq_1_to_10 WHERE seq IN TABLE_STR ('5; 6; 10' ';')
could provide a virtual table from any line
SELECT * FROM TABLE_STR ('Aaa; zzz; xxx; bbb', ';') AS t1
seq -------------- Aaa zzz xxx bbb
and continue to use it in a cursor, etc.
SELECT SUBSTRING_INDEX (seq, '=', 1) as key SUBSTRING_INDEX (seq, '=', - 1) as value FROM TABLE_STR ('key1 = value1; key2 = value2; key3 = value3; key4 =', ';') AS t1
key value ------ -------- key1 value1 key2 value2 key3 value3 key4
Gliffy Diagrams
Attachments
Issue Links
- is blocked by
-
MDEV-5199 Table functions (a.k.a UDF returning arrays / result set)
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Also it would be more useful than COLUMN_LIST
SELECT COLUMN_LIST(@test);
`INN`,`check`,`resCntr`,`citizens`,`birthdate`,`check_grp`,`firstname`,`birthplace`,`id_profile`,`middlename`,`secondname`,`id_education`,`old_firstname`,`id_army_status`,`id_family_type`,`old_middlename`,`old_secondname`,`reason_fio_chg`,`id_social_state`
because get list of columns in table form which can be easily joined or converted to string with delimiter.