oracle select first 10 rows

SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
    WHERE ROWNUM >= 1 AND ROWNUM <=10;
-- Oracle 12c:
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 10 ROWS ONLY;

4.86
7
Phoenix Logan 186120 points

                                    -- NOTE: This is for Oracle/PLSQL only

-- &gt; EXAMPLE
select * 
from CONSUMERS
where ROWNUM &lt;= 1

/*
-- &gt; SYNTAX
select * 
from {yourTable}
where ROWNUM &lt;= {number-of-rows}

*/

4.86 (7 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
select the first row in oracle oracle sql select first row oracle first fetch n rows oracle just get first row select first 10 rows in oracle sql developer first 10 rows in oracle oracle 11 select first 1000 rows oracle select first 1000 rows fetch first record in oracle fetch first 20 row only oracle sql FIRST ROW IN ORACLE how to select the first 100 rows in oracle database select first record oracle sql select first 10 records in oracle oracle fetch first rows only how to fetch first 10 rows in oracle how to get first 3 rows in oracle oracle sql fetch first 10 rows first_rows oracle oracle get first row from query how to select first 10 rows in sql oracle HOW TO SELECT FIRST ROW OF EACH TYPE IN ORACLE oracle sql fetch first 1 row only gives error Oracle 12 Syntax: fetch first row oracle fetch first n rows first row in oracle fetch first 10 rows in oracle sql developer only first row in oracle fetch first 10 rows in oracle sql SELECT FIRST ORACLE oracle sql how to select first row select first row in oracle sql select first 10 rows oracle sql select top 10 rows oracle select top 10 rows in oracle oracle select first n rows oracle select first 10 rows oracle fetch first row only oracle select first result oracle sql first row only select first 10 rows in oracle sql first row oracle return first row in oracle' oracle - get first row oracle sql first row oracle sql select first 10 rows show only the first row oracle sql select first row sql oracle select first row oracle sql oracle fetch 1 row with column only select first row in oracle oracle first row only oracle sql select first take first result pl/sql select first element into pl/sql select first result into pl/sql how to get first row oracle oracle sql fetch only first row select first row oracle Oracle get first row oracle first row select oracle first row oracle retorn to one line oracle select all but first row oracl sql entry oracle select first row
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source