MySQL Forums
Forum List  »  Quality Assurance

Order by with group by, different results from different versions of mysql server
Posted by: Lars Gustafsson
Date: August 26, 2011 09:19AM

I have locally on my PC
Code:

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| protocol_version | 10 |
| version | 5.1.47-community |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | ia32 |
| version_compile_os | Win32 |
+-------------------------+------------------------------+

the server version is:
Code:

Serverversion: 5.1.55
Protokollversion: 10
UTF-8 Unicode (utf8)

The thread below solved my problem locally, but from the production server I get only 11 rows. Locally I get 32. If I check the data in both databases with another query. I get all 36 rows on both servers as I should.
MySQL ORDER BY with GROUP BY PHP Server Side Scripting forum at WebmasterWorld
This is my query:
Code:

SELECT publisher_keyword_bids . *
FROM publisher_keyword_bids
INNER JOIN (SELECT MAX( publisher_keyword_bid_id ) AS id
FROM publisher_keyword_bids
GROUP BY ad_group_keyword_id
)ids ON publisher_keyword_bids.publisher_keyword_bid_id = ids.id
WHERE `publisher_id` =79
AND `created`
BETWEEN '2011-08-08 07:00:00'
AND '2011-08-08 13:00:00'
ORDER BY `created` DESC;

How do I get 32 rows from Serverversion: 5.1.55?

Options: ReplyQuote


Subject
Views
Written By
Posted
Order by with group by, different results from different versions of mysql server
3457
August 26, 2011 09:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.