Given a table
field1 | field2
abc | 1
efg | 30
etc | 10
I would like to run a query like SELECT offset() FROM table WHERE field1 = 'etc' ORDER BY field2 DESC
Such an imaginary query should return 2 (ordering by field2 desc, field1 = etc is the second row)
Any clean way to do this?
Thanks
If you mean by row offset that: The rank of the row after ordering the results with
order by field2 DESCwhich hasfield1 = 'etc', Then you could do something like:This should return 2.