How to select top five or 'N' rows in Oracle 11g

oracle, oracle11g, sql, syntax-error

Solution

You'll need to use `DISTINCT` before you select the "top 5":

SELECT * FROM 
(SELECT DISTINCT ani_digit, ani_business_line FROM cta_tq_matrix_exp) A
WHERE rownum <= 5

Problem

``` select distinct ani_digit, ani_business_line from cta_tq_matrix_exp limit 5 ``` I want to select top five rows from my resultset. if I used above query, getting syntax error.

Original source

Related problems