在mysql中使用group_concat时,它将获取有限的数据集 [英] when using group_concat in mysql it will fetching limited set of data

查看:76
本文介绍了在mysql中使用group_concat时,它将获取有限的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...
我有这样的查询:

hi all...
i have a query like this :

SELECT group_concat( DISTINCT '',`fromfirstname`,': ','',`message` SEPARATOR '<br />' ) as Message,`fromusername`,`tousername`,`sessionname`,tofirstname,concat(DATE_FORMAT(`sentdate`,'%W , %b %d , %Y '),' ',`senttime`) as DateandTime FROM `tableins` WHERE  ((fromusername='" + sess + "' or tousername='" + toid + "') OR (fromusername='" + toid + "' or tousername='" + sess + "')) AND sentdate='" + DateTime.Now.ToString("yyyy-MM-dd") + "' GROUP BY `sessionname` ORDER BY `id` DESC


它会返回到一些有限的字符,这里我的问题是我需要获取表中显示的所有数据.这个问题让我受了很多苦.
任何人都可以帮我吗......
在此先感谢


it will returns upto some limited charecters here my problem is i need to get all the data presented in table. i was suffered a lot with this issue..
can any one help me please....
thanks in advance

推荐答案

此处有关如何通过串联多个group_concat结果来克服此限制(1024个限制)的信息. http://code.openark.org/blog/mysql/sql-trick-overcoming-group_concat-limitation-in-特殊情况 [
Here info on how to overcome this limit (of 1024) by concatenating multiple group_concat results.
http://code.openark.org/blog/mysql/sql-trick-overcoming-group_concat-limitation-in-special-cases[^]

You could also change the group_concat_max_len system variable to meet your needs.

Good luck!


这篇关于在mysql中使用group_concat时,它将获取有限的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆