MySQL Forums
Forum List  »  General

Re: subquery bug ?
Posted by: Mike ART
Date: March 13, 2017 10:50PM

Hi Peter,
I understand "Group By is specified to return arbitrary values for columns that neither aggregate nor Group By", but in my opinion, it does not explain the differential results between method 1 and method 2.

I think I've got stuck here somehow, and can't get it through. Can you please tell me if method 1 is identical to method 2 (in terms of results) ? if not, why ?


Method 1

>create table test2 as (select * from test order by id, type DESC);
> select * from test2 group by id;

Method 2

> select * from (select * from test order by id,type desc) as t group by id;



Thank you very much.

Options: ReplyQuote


Subject
Written By
Posted
March 10, 2017 02:01AM
March 10, 2017 12:21PM
March 11, 2017 09:52PM
March 11, 2017 02:27PM
March 11, 2017 09:42PM
March 11, 2017 10:02PM
Re: subquery bug ?
March 13, 2017 10:50PM
March 16, 2017 10:47AM


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.