As Heath said, you need to use dynamic SQL to use any Analytical functions prior to 9i. This is not a big deal. Simply wrap the statement in quotes; stick it in a variable and do an OPEN or EXECUTE IMMEDIATE on the variable. Note that this would be *much* faster than hacking it using cursors, etc.

- Chris