How to divide query output into groups in oracle?



How to divide query output into groups in oracle?..

Answer / Swati Chandra

In Oracle, you can use the analytic functions like ROW_NUMBER() OVER (ORDER BY column_name) to assign a row number to each row in your result set and then use it to group the rows. Here is an example: SELECT * FROM (SELECT column1, column2, ROW_NUMBER() OVER(ORDER BY column_name) as row_num FROM table_name) WHERE row_num % n = 0; This will divide your output into groups of n rows.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

What is a procedure in oracle?

1 Answers  


What is a Tablespace?

5 Answers  


How to use "for" statements in oracle?

1 Answers  


What is define in oracle?

1 Answers  


What is a nested table and how is it different from a normal table?

1 Answers  


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

1 Answers   Infosys,


How to define a specific record type?

1 Answers  


Difference between oracle's plus (+) notation and ansi join notation?

1 Answers  


WHAT IS ecc 6.0

1 Answers  


What is a cursor and what are the steps need to be taken?

1 Answers  


Will you be able to store pictures in the database?

1 Answers  


List out the types of joins.

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)