SQL command not properly ended Do you see why is appearing this error "SQL command not properly ended" in the select statement below?

Select command in oracle:

 select
        l_orderkey,
        sum(l_extendedprice * (1 - l_discount)) as revenue,
        o_orderdate,
        o_shippriority
    from
        customer,
        orders,
        lineitem
    where
        c_mktsegment = 'BUILDING'
        and c_custkey = o_custkey
        and l_orderkey = o_orderkey
        and o_orderdate &lt; date '1995-03-15'
        and l_shipdate &gt; date '1995-03-15'
    group by
        l_orderkey,
        o_orderdate,
        o_shippriority
    order by
        revenue desc,
        o_orderdate
     where rownum &lt;= 10;
The syntax you used was invalid. This is how you select the first 10 rows in pre-12c versions.

select * from
(
 select
        l_orderkey,
        sum(l_extendedprice * (1 - l_discount)) as revenue,
        o_orderdate,
        o_shippriority
    from
        customer,
        orders,
        lineitem
    where
        c_mktsegment = 'BUILDING'
        and c_custkey = o_custkey
        and l_orderkey = o_orderkey
        and o_orderdate &lt; date '1995-03-15'
        and l_shipdate &gt; date '1995-03-15'
    group by
        l_orderkey,
        o_orderdate,
        o_shippriority
    order by
        revenue desc,
        o_orderdate
)
     where rownum &lt;= 10;