The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> MySQL Help
|
Help with group_concat, new to mysql
Discuss Help with group_concat, new to mysql in the MySQL Help forum on Dev Shed. Help with group_concat, new to mysql MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 16th, 2012, 09:54 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 14 m 15 sec
Reputation Power: 0
|
|
|
Help with group_concat, new to mysql
it appears that maybe a system parm needs to be changed when using group_concat, I am inserting the group_concat into a text field and it appears that when I reach some size limit the insert crashed. I have tried to define the field as text, longtext, blob, longblob with no success. I know the data I am inserting does not exceed the allowable text size
thanks in advance
bruce 
|

October 16th, 2012, 10:27 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
|
could you do a SHOW CREATE TABLE for the tables involved, as well as showing the query
|

October 16th, 2012, 10:45 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 14 m 15 sec
Reputation Power: 0
|
|
|
create table temp
(
kid double,
api_number varchar(255),api_num_nodash double,lease varchar(255),well varchar(255),
field varchar(255),latitude double,longitude double,long_lat_source varchar(255),
township double,twn_dir varchar(255),rangex varchar(255),range_dir varchar(255),
section double ,spot varchar(255),feet_north double,feet_east double,
foot_ref varchar(255),rig_operator varchar(255),curr_operator varchar(255),elevation double,
elev_ref varchar(255),depth double,form_at_depth varchar(255),produce_form varchar(255),
permit datetime,spud datetime,completion datetime,plugging varchar(255),
oil_kid double,gas_kid double,status varchar(255),status2 varchar(255),
comments varchar(255),final longtext);
INSERT into temp
select b.kid,b.api_number,b.api_num_nodash,b.lease,b.well,b.field,b.latitude,b.longitude,b.long_lat_source,
b.township,b.twn_dir,b.rangex,b.range_dir,b.section,b.spot,b.feet_north,b.feet_east,b.foot_ref,b.ori g_operator,b.curr_operator,
b.elevation,b.elev_ref,b.depth,b.form_at_depth,b.produce_form,b.permit,b.spud,b.completion,b.pluggin g,b.oil_kid,
b.gas_kid,b.status,b.status2,b.comments,(select group_concat(ltrim(rtrim(a.elev_ref)) ,',',ltrim(rtrim(a.formation)),
',',ltrim(rtrim(a.top)),',',quote(a.base) SEPARATOR ' # ')
from tops_ks_cheyenne_co as a where a.kid = b.kid )
from wells_ks_cheyenne_co as b ORDER BY 1;
the problem is when I insert another field after ',',quote(a.base)
|

October 16th, 2012, 10:51 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 14 m 15 sec
Reputation Power: 0
|
|
|
before adding a new field the max width of the group_concat is 863 characters, after the addition i estimate the width to be 2000 characters
|

October 16th, 2012, 11:24 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
|
you said it "crashed" -- what error message did you get?
and could you do the SHOW CREATE TABLE for the tops_ks_cheyenne_co table
|

October 16th, 2012, 11:36 AM
|
|
|
|

October 16th, 2012, 01:16 PM
|
 |
Hockey face
|
|
Join Date: Nov 2001
Location: St. Catharines, Canada
|
|
Quote: | Originally Posted by cafelatte I know, I know - I'm just guessing again... |
Twenty lashes on the back with a wet noodle and DON'T do it again!
|

October 16th, 2012, 02:14 PM
|
|
|
|
Ah, you've read 50 shades of grey too. [spoiler alert]
|

October 16th, 2012, 04:40 PM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
50? all i need is one 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|