>SELECT title
>FROM bep_resource
>WHERE 1 = 1
>ORDER BY UPPER(title)
>Does it look right?

yep.

>SELECT t.*, ROWNUM AS RN
>FROM (
...
>ORDER BY UPPER(title)
>) t
>
>Still good?

yep.  This is the step that Pascal suggsted and the one that makes a difference.

>Next Step:
>SELECT * FROM (
>SELECT t.*, ROWNUM AS RN
>FROM (
>SELECT title
>FROM bep_resource
>WHERE 1 = 1
>ORDER BY UPPER(title)
>) t )
>
>
>Final step:
>....
>WHERE rownum >=1
>AND   rownum <=10
>
>Where do thinks go wonky?

In this setup, it all works great, at least for 1 through 10 but it's an 
example.  The second step "SELECT t.*, ROWNUM AS RN" does the trick.  I'm not 
sure why this works though.  Pascals does the WHERE differently in that one 
part of the WHERE is in the middle (2nd) query.  The order of the WHERE appears 
to be necessary in this way, rather than having both parts of the WHERE at the 
end.

- So, I get the whole recordset and alphabetize, which I'd done before.
- Then, I take that recordset and grab the whole thing again, but this time get 
a ROWNUM.  This doesn't seem to adjust the record set at all, but gives it the 
variable information of rownum.  In Pascal's version the WHERE end_num is done 
here.
- The outter-most query does the paging part and in Pacal's it finishes the 
WHERE with the begin_num part.

I guess I really don't understand enough of this query to reproduce or use as 
programming knowledge in the future.  I don't see why this alphabetizes it 
better since both do the ordering at the same level.  I don't see how adding 
the middle query adjusts things.  It'd be nice to get this a little better and 
not have to ask so many questions in the future.

and oh, thanks alot for the assistance.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192078
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to