I have a view defined on a table:
 
    "create view myview as select myid from mytable where <complex
filtering criteria> order by <complex sort criteria>"
 
This works beautifully - "select * from myview" always retrieves the
rows in the sort order defined.
 
Given a relative position "i" - I can easily retrieve "myid" for that
position 
 
    "select myid from myview limit 1 offset i"
 
The challenge is to find the opposite: I.e. Given "this_myid" - somehow
retrieve the relative position in the view.
 
At present I have a "counting" callback function on "select myid from
myview" that returns the number of rows encountered before
myid=this_myid - severely inefficient.
 
Any other ideas?
 
 
Thanks,
Eli
 
 
***********************************************************************************
This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message.
***********************************************************************************

Reply via email to