MySQL Forums
Forum List  »  Oracle

Re: a solution for update
Posted by: David Ashman
Date: February 05, 2009 04:49PM

I also stumbled on this thread trying to find a solution using rownum.

My query was to select the X row in a table, AFTER sorting it.

My solution was this:
SELECT t.*
  FROM `table` t, (SELECT @rownum := 0) as r
  HAVING (@rownum := @rownum + 1) = X
  ORDER BY `count` DESC

Options: ReplyQuote


Subject
Views
Written By
Posted
17606
August 06, 2004 12:28AM
28242
September 26, 2004 09:04AM
11877
October 09, 2004 03:02PM
22497
October 10, 2004 12:56PM
12351
December 22, 2004 07:05AM
13355
December 22, 2004 01:59PM
9545
April 13, 2005 01:25PM
12836
April 14, 2005 12:08AM
6994
April 26, 2005 02:12AM
7523
April 20, 2005 04:37PM
9861
April 23, 2005 09:48AM
5536
August 26, 2008 03:47AM
5764
April 26, 2005 02:16AM
5509
October 18, 2005 02:57PM
5447
November 16, 2005 04:58PM
18981
August 08, 2006 07:45AM
5229
December 14, 2008 10:01PM
Re: a solution for update
5393
February 05, 2009 04:49PM
4592
December 27, 2008 03:27AM
4690
December 27, 2008 04:19AM
6424
February 08, 2007 02:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.