Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013

    Unanswered: MySQL grouping not working for me

    I have a query that I am trying to group that I am not getting the results that I need in terms of it grouping them here is the query:

    SELECT c.login, count(cc.case_id) SESSION_ID, SITE_NAME, Manager,
    (Select CONCAT(WEEK(c.Comm_date_UTC))
    from communications
    group by 'week')
    from case_details cd
    join case_communications cc on cd.case_id=cc.case_id
    join communications c on cc.comm_id=c.comm_id
    where CONVERT_TZ(cc.Creation_DATE,'+00:00','+10:00')
    Group by c.login
    limit 100;

    So what this is doing is giving me the following:

    So the grouping by the login is working, but not buy the week, what I wanted to see is:

    Note that its grouped by the week and login now, this is what I am trying to get

    Any help?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    so add the week item to the grouping clause on th outer select as opposed to the sub select
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts