If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > issues w/ group_concat- it truncates the data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-16-11, 15:51
mdumayac mdumayac is offline
Registered User
 
Join Date: Apr 2011
Posts: 2
issues w/ group_concat- it truncates the data

Hello,

I'm trying to use a group_concat on select. For some reason, it trunscates my data (it cuts off at row 43 when I'm supposed to have 92 rows of data). When I take off the group_concat and only use SELECT me.SUBJECT, all my 92 rows of data show.

Can anyone advice? Thank you.



SELECT CONCAT("'",GROUP_CONCAT(me.SUBJECT SEPARATOR "','"),"'")
FROM myaccountmyevents AS me
LEFT JOIN auth AS a ON me.createdBy=a.username
LEFT JOIN eventcalendarimages AS ei ON me.category=ei.eventCalendarImageId
LEFT JOIN businessurlalias AS bua ON bua.calendarEventId=me.calendarEventId
LEFT JOIN businessbios AS bb ON bb.businessOptionsBiosId=bua.businessOptionsBiosId
WHERE me.OWNER=1 AND startDateFull > '2011-05-13' AND whichShare > 0
AND (me.city='Aurora'
OR me.city='Broomfield'
OR me.city='Lakewood'
OR me.city='Littleton'
OR me.city='Thorton'
OR me.city='Westminster'
OR me.city='Arvada'
OR me.city='Wheat Ridge'
OR me.city='Commerce City'
OR me.city='Greeley'
OR me.city='Brighton'
OR me.city='Lousville'
OR me.city='Lafayette'
OR me.city='Centennial'
OR me.city='Greenwood Village'
OR me.city='Bow Mar'
OR me.city='Columbine Valley'
OR me.city='Glendale'
OR me.city='Mountain View'
OR me.city='Northglenn'
OR me.city='Denver'
OR me.city='Castle Rock'
OR me.city='Sheridan'
OR me.city='koko')
OR me.city='Highlands Ranch' AND (me.state='Colorado')
ORDER BY me.startDateFull;
Reply With Quote
  #2 (permalink)  
Old 06-16-11, 16:18
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
you messed up your ANDs and ORs

WHERE me.OWNER=1 AND startDateFull > '2011-05-13' AND whichShare > 0
AND (me.city='Aurora'
OR me.city='Broomfield'
OR me.city='Lakewood'
OR me.city='Littleton'
OR me.city='Thorton'
OR me.city='Westminster'
OR me.city='Arvada'
OR me.city='Wheat Ridge'
OR me.city='Commerce City'
OR me.city='Greeley'
OR me.city='Brighton'
OR me.city='Lousville'
OR me.city='Lafayette'
OR me.city='Centennial'
OR me.city='Greenwood Village'
OR me.city='Bow Mar'
OR me.city='Columbine Valley'
OR me.city='Glendale'
OR me.city='Mountain View'
OR me.city='Northglenn'
OR me.city='Denver'
OR me.city='Castle Rock'
OR me.city='Sheridan'
OR me.city='koko')

OR me.city='Highlands Ranch' AND (me.state='Colorado')

you have two compound conditions -- the red one and the blue one

if either is true, that row is kept
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On