here is query which is similar to the one which I want to execute:
with x as(
    select ds.*, row_number() over (partition by FOO order by BAR) rn
    from datasource ds
    where datasupplierid = 3)
select column1, column2, rn from x where rn <= 2
And I'm executing it like this (from c#):
using (var con = new OracleConnection(this.connectionString)) {
    con.Open();
    OracleCommand cmd = con.CreateCommand();
    cmd.CommandText = this.command;//my query
    cmd.CommandType = CommandType.Text;
    var reader = cmd.ExecuteReader();
}
What I'm taking from this is ORA-00933: SQL command not properly ended error.
I've tried to rewrite query to this form:
select column1, column2, rn from (
    select ds.*, row_number() over (partition by FOO order by BAR) rn
    from datasource ds
    where datasupplierid = 3)
where rn <= 2
But this hadn't fixed my issue. Is there a way to execute such query?
 
    