PL/SQL (MOSC)

MOSC Banner

Min and Max value for group values

edited Oct 12, 2015 2:35AM in PL/SQL (MOSC) 2 commentsAnswered ✓

Need min value and max value based on group by

select invoice_id,floor(rownum/20) from ap_invoices_all;


invoice_id floor(rownum/20)

  1           0

  2           0

  3           0

  4           0

  5           0

  6           0

  7           0

  8           0

  9           0

  10           1

  11           1

  12           1

  13           1

  14           1

  15           1

  16           1

  17           1

  18           1

  19           1

  20           2

  21           2

  22           2

  23           2

  24           2

  25           2

  26           2

  27           2

  28           2

  29           2

O/p  needed 

  for 0 min:0, max :9

  for 1 min :10, max :19

  for 2 min :20, max :29

Thanks

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center