adspace


How to divide query output into groups in oracle?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write a left outer join with the where clause in oracle?

1155


Design database draw er diagram for a certain scenario ?

4656


How to use values from other tables in update statements using oracle?

1158


How to start an oracle instance?

1103


How to put more than 1000 values into an oracle in clause?

1115


How to select all columns of all rows from a table in oracle?

1132


Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com

1956


What is oracle latest version?

1174