Sort by Group By field does not work
|Query.gif (9.47 KB) Query.gif||Michalis Miatidis, 2010-08-13 13:04|
|Result.gif (5.77 KB) Result.gif||Michalis Miatidis, 2010-08-13 13:05|
Updated by Jean-Baptiste Barth about 13 years ago
In the screenshot, the groups are not sorted like expected (from a user point of view I mean, this may be a "standard" SQL behavior, I'm not sure). Group 1.1.0 is displayed before group 1.0.1, whereas Michalis asked for a sort by target version ascending.
Updated by Felix Schäfer about 13 years ago
Ah, I think I know what's happening :-)
The "group by" and "sort by" don't influence each other. If you remove the "group by", the issues will be sorted correctly/as expected, if you specify a "group by", the issues inside the groups will be sorted correctly/as expected, but that won't influence the order of the groups. In the case where you select the same attribute to "group by" and "sort by", well, they are sorted "correctly" inside each group, though you don't see anything of it as they all have the same value for that attribute, rendering any sort of sorting moot.
Updated by Moritz Voss almost 13 years ago
Jean-Baptiste Barth wrote:
OH: I just discovered you can "GROUP BY blah ASC" in at least sqlite and mysql. Needs to be tested, but we may have a clean workaround if it's supported on each of our databases and/or by rails adapters.
It'd be very intuitive to have it grouped, and even choose which way to group in another dropdown (just like the ordering in the other drop downs)