Submission Results in Internal Error


  • 0

    Is there an issue with submitting MySQL solutions now? I attempted to submit the following solution but received an "Internal Error" instead of AC.

    select m.Name
    from Employee as m
    inner join Employee as e
    on e.ManagerId = m.Id
    group by m.Id
    having count(e.Id) >= 5;
    

    I tested this solution locally with the following test script and it produced the correct result:

    create table Employee (
    Id int unsigned primary key auto_increment,
    Name varchar(32) not null,
    Department char(1) not null,
    ManagerId int unsigned,
    foreign key fk_manager_id(ManagerId) references Employee(Id)
    ) engine=InnoDb charset=utf8;
    
    insert into Employee (Id, Name, Department, ManagerId) values
    (101, 'John', 'A', null),
    (102, 'Dan', 'A', 101),
    (103, 'James', 'A', 101),
    (104, 'Amy', 'A', 101),
    (105, 'Anne', 'A', 101),
    (106, 'Ron', 'B', 101);
    
    select m.Name from
    Employee as m
    inner join Employee as e
    on e.ManagerId = m.Id
    group by m.Id
    having count(e.Id) >= 5;
    

    This outputs:

    +------+
    | Name |
    +------+
    | John |
    +------+
    1 row in set (0.01 sec)
    

  • 0

    Thanks for reporting, this is fixed now.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.