This isn't answer but ON TOPIC question

From: Mechanical Mann <eric_at_REMOVE_SPAMspeco.com>
Date: Thu, 1 Nov 2001 10:27:39 -0600
Message-ID: <9rrt7q$krq$1_at_bob.news.rcn.net>


my_table has values
1, 3, 4, 5, 6, 7, 11, 9

This query returns the value 2

SELECT MIN(my_num)
FROM my_table
WHERE ROWNUM <> my_num
ORDER BY my_num
/

It appears that when you use ROWNUM as criteria stuff gets weird.

The first intermediate result is: ROWNUM = 1 and my_num = 1. Therefore the condition is not satisfied. The next intermediate result is ROWNUM = 1 and my_num = 2. The condition is satisfied.

Thus you can't use ROWNUM to "parallel" your column values to look for a "hole"

Comments anyone?

Eric Received on Thu Nov 01 2001 - 17:27:39 CET

Original text of this message