Comments on: Unwalking a string with GROUP_CONCAT https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat Blog by Shlomi Noach Sat, 05 May 2012 13:25:31 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: Anthony https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-89467 Sat, 05 May 2012 13:25:31 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-89467 Nice article.

The SET SESSION group_concat_max_len = 1000000 was exactly the info I required.

I had trouble with this issue as follows:-

I used group_concat() in isolation and no truncation occured.

I used the same “isolated” group_concat() query as a subquery and joined to it. Then truncation occurred but NO WARNING/ERROR.

I moved the subquery into a temp table and then joined on that. Then, the now infamous 1260 ERROR was thrown.

Needless to say, problem solved!

]]>
By: SQL: selecting top N records per group | code.openark.org https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-26386 Thu, 06 Jan 2011 11:37:20 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-26386 […] string walking. Examples for string walking (described in the excellent SQL Cookbook) can be found here, here and here. We’ll be using a numbers table: a simple table which lists ascending integer […]

]]>
By: Checking for string permutation | code.openark.org https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-10973 Wed, 24 Feb 2010 21:50:08 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-10973 […] to business: how do we normalize a text using SQL? Well, once again, string walking and string unwalking to the rescue. The trick is to break the string apart (to distinct characters), then re-combine the […]

]]>
By: Rotating SQL graphs horizontally | code.openark.org https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2781 Thu, 23 Jul 2009 13:11:17 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2781 […] Unwalking a string with GROUP_CONCAT […]

]]>
By: Shantanu Oak https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2654 Tue, 14 Jul 2009 14:15:18 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2654 Yes, I got exactly the same warning and after following your tip, I got the results. Thanks.

]]>
By: Roland Bouman https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2651 Tue, 14 Jul 2009 11:30:37 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2651 Hi Shantanu,

do you get any warnings? If group_concat_max_len really is too short to hold the result, you should get a warning:

1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+———+——+————————————–+
| Level | Code | Message |
+———+——+————————————–+
| Warning | 1260 | 1 line(s) were cut by GROUP_CONCAT() |
+———+——+————————————–+

If you want to be sure, don’t set group_concat_max_len to a particular length, just set it to max_allowed_packet. This is the practical maximum of any string length and if you exceed that you will get an entirely different error message, see: http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

]]>
By: Shantanu Oak https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2649 Tue, 14 Jul 2009 08:12:16 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2649 I forgot to mention one thing about group_concat. I am getting 54 strings as against expected 74 when I use group_concat. I do not have access to my.cnf file so I changed the session variable but it did not help.
SET SESSION group_concat_max_len = 1000000;

]]>
By: Shantanu Oak https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2647 Tue, 14 Jul 2009 06:08:29 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2647 I was just thinking of writing a SP.
Thanks a lot for sharing this.
I selected the int_col because I wanted the exact position of the character.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2445 Wed, 24 Jun 2009 16:59:39 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2445 Hi,

Why, with GROUP_CONCAT, of course.
You’ll need to create the icon (created mine with TheGimp),
name it favicon.ico and put it in your theme directory (so one icon per theme)

Edit header.php and add the following inside your <head> tag:
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />

That should do the work

]]>
By: RT https://shlomi-noach.github.io/blog/mysql/unwalking-a-string-with-group_concat/comment-page-1#comment-2443 Wed, 24 Jun 2009 14:46:42 +0000 https://shlomi-noach.github.io/blog/?p=840#comment-2443 Hi Shlomi,
Can you please tell how you added that favicon to your blog…

RT.

]]>