Forum Discussion

lotussutol's avatar
lotussutol
Frequent Visitor
8 years ago
Solved

DataSource.Error: Oracle: ORA-00911: invalid character

I am looking for help on why the following SQL does not work in Power BI.   The SQL I have works fine when I test it in TOAD but when I try it in Power BI I get the following error. DataSource.Err...
  • Anonymous's avatar
    Anonymous
    8 years ago

    lotussutol,

    Please remove semicolon at the end of your command. I can import data to Power BI Desktop successfully when I execute this statement :

    WITH q as ( 
        select        table1.name as label,        count(table1.id) as count_id,        
            row_number() over (order by count(table1.id) desc) as rn    
        from table1   
        where table1.name like 'D%'  
        group by table1.name)
    select
        case
            when rn <= 9
            then label
            else 'Other'
        end label,    sum(count_id) count_id from q group by
        case
            when rn <= 9
            then label
            else 'Other'
        end

     


    Regards,
    Lydia