mysql error - error number 1140

Discussion in 'PHP' started by antpeks, Jan 8, 2011.

  1. #1
    i get the following error, it worked perfectly, until i moved servers and restored the backups.


    Query Executed: SELECT SUM(a.impression_rate) as sum_imp_rate, COUNT(a.user_id) as count_imp, b.user_id, b.username, b.email_address FROM `mmh_file_impression` AS a INNER JOIN `mmh_user_info` AS b ON a.user_id = b.user_id WHERE a.user_id = '103' AND `status` = '1';
    Code (markup):
    Time Encountered: January 8, 2011, 11:47:21 AM
    URL Location: http://xxxx.xxx/admin.php?act=account-s-s&id=103
    IP Address: 83.1xx.114.xxx
    
    Error: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
    
    Error Number: 1140
    Code (markup):
    can someone help me figuring out what is happening here..
     
    antpeks, Jan 8, 2011 IP
  2. Minimal Hank

    Minimal Hank Peon

    Messages:
    136
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Minimal Hank, Jan 8, 2011 IP
  3. antpeks

    antpeks Well-Known Member

    Messages:
    394
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #3
    any change on a little explaination how to do this, as i am newbie in Sql coding
     
    antpeks, Jan 8, 2011 IP
  4. Minimal Hank

    Minimal Hank Peon

    Messages:
    136
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    One way is to switch to ANSI or to remove it from the mode list.

    SELECT @@sql_mode;
    Code (markup):
    Can you please show us the output ?
     
    Minimal Hank, Jan 8, 2011 IP