
|
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 » |
made changes - 17/Feb/07 12:41 AM
| Field |
Original Value |
New Value |
|
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, should have thrown an error
----------------------------------
1 |a |2
2 |b |3
3 |c |4
3 rows selected
|
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
|
made changes - 29/May/07 01:29 AM
|
Assignee
|
|
Bryan Pendleton
[ bryanpendleton
]
|
made changes - 12/Aug/07 10:25 PM
|
Resolution
|
|
Fixed
[ 1
]
|
|
Fix Version/s
|
|
10.4.0.0
[ 12312540
]
|
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
made changes - 13/Aug/07 02:39 PM
|
Fix Version/s
|
|
10.3.2.0
[ 12312670
]
|
|
Affects Version/s
|
|
10.3.1.4
[ 12312590
]
|
|
Affects Version/s
|
|
10.2.1.6
[ 11187
]
|
made changes - 14/Aug/07 02:19 PM
|
Fix Version/s
|
|
10.3.1.5
[ 12312671
]
|
made changes - 19/Feb/08 12:30 AM
|
Status
|
Resolved
[ 5
]
|
Reopened
[ 4
]
|
|
Resolution
|
Fixed
[ 1
]
|
|
made changes - 29/Feb/08 09:12 PM
|
Fix Version/s
|
10.3.2.1
[ 12312876
]
|
|
|
Fix Version/s
|
|
10.3.2.2
[ 12312885
]
|
made changes - 04/Mar/08 05:47 PM
|
Derby Info
|
|
[Existing Application Impact]
|
made changes - 06/Mar/08 04:29 AM
made changes - 08/Mar/08 08:45 PM
made changes - 16/Mar/08 03:51 AM
|
Resolution
|
|
Fixed
[ 1
]
|
|
Fix Version/s
|
|
10.4.1.0
[ 12313072
]
|
|
Fix Version/s
|
|
10.5.0.0
[ 12313010
]
|
|
Status
|
Reopened
[ 4
]
|
Resolved
[ 5
]
|
made changes - 02/Apr/08 08:29 AM
|
Derby Info
|
[Existing Application Impact]
|
[Existing Application Impact, Release Note Needed]
|
made changes - 04/May/09 06:22 PM
|
Fix Version/s
|
10.5.0.0
[ 12313010
]
|
|
|
Fix Version/s
|
|
10.5.1.1
[ 12313771
]
|
made changes - 30/Jun/09 04:12 PM
|
Issue & fix info
|
[Release Note Needed, Existing Application Impact]
|
[Release Note Needed]
|
|