Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
This task will cover the following phases of window functions processing:
Parsing
Name resolution and other semantic analysis
Optimization and building all data structures needed for execution.
Attachments
Issue Links
- blocks
-
MDEV-6115 window functions as in the SQL standard
-
- Closed
-
Name resolution doesn't currently work when window functions are used with group by. Here is an example:
create table t1 (
username varchar(32),
amount int
);
insert into t1 values
('user1',1),
('user1',5),
('user1',3),
('user2',10),
('user2',20),
('user2',30);
select
username,
sum(amount),
rank() over (order by sum(amount) desc)
from t1
group by username;
The query is valid, but I get this error:
ERROR 1111 (HY000): Invalid use of group function