
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
|
|
Environment:
|
Any
|
|
Issue Links:
|
Reference
|
|
This issue relates to:
|
|
DERBY-3373
SQL "distinct" and "order by" needed together
|
|
|
|
|
DERBY-2085
Misleading error message for non-matching ORDER BY clause in queries with GROUP BY.
|
|
|
|
|
|
This issue is related to:
|
|
DERBY-2805
ASSERT failure with sane build if DISTINCT and ORDER BY are present in a query that selects from a diagnostic table function.
|
|
|
|
|
|
|
| Issue & fix info: |
Release Note Needed
|
| Resolution Date: |
16/Mar/08 03:51 AM
|
|
When distinct is in the select list and the query has order by with expression, the resultset produced contains an additional column.
ij> create table t1 (c1 int, c2 varchar(10))
0 rows inserted/updated/deleted
ij> insert into t1 values (1,'a'),(2,'b'),(3,'c');
3 rows inserted/updated/deleted
select distinct c1, c2 from t1 order by c1;
C1 |C2
----------------------
1 |a
2 |b
3 |c
3 rows selected
ij> select distinct c1, c2 from t1 order by c1+1;
C1 |C2 |3 <=====returns 3 columns, incorrect result returned
----------------------------------
1 |a |2
2 |b |3
3 |c |4
3 rows selected
|
|
Description
|
When distinct is in the select list and the query has order by with expression, the resultset produced contains an additional column.
ij> create table t1 (c1 int, c2 varchar(10))
0 rows inserted/updated/deleted
ij> insert into t1 values (1,'a'),(2,'b'),(3,'c');
3 rows inserted/updated/deleted
select distinct c1, c2 from t1 order by c1;
C1 |C2
----------------------
1 |a
2 |b
3 |c
3 rows selected
ij> select distinct c1, c2 from t1 order by c1+1;
C1 |C2 |3 <=====returns 3 columns, incorrect result returned
----------------------------------
1 |a |2
2 |b |3
3 |c |4
3 rows selected
|
Show » |
| No work has yet been logged on this issue.
|
|