List:General Discussion« Previous MessageNext Message »
From:Dennis Lukefahr Date:December 15 2000 3:35pm
Subject:Re: Question about ROWNUM. Anything similar in MySQL
View as plain text  
Yes, I am asking for what the LIMIT statement does.  My understanding is that the LIMIT
clause has to be coded after the ORDER by clause.  The tool I'm presently using ONLY
allows me to interject code into the WHERE portion of the select clause.  ORACLE's
pseudo-column ROWNUM can be used in the where portion of the SELECT statement prior to
the ORDER by clause.  

Dennis Lukefahr

>>> John Cichy <john@stripped> 12/15/00 09:56AM >>>
Dennis,

It would seem that what you are asking for is what LIMIT does. Take a
look at:

http://www.mysql.com/documentation/mysql/commented/manual.php?section=SELECT 

near the bottom of the page. 

Have a great day...
John

Dennis Lukefahr wrote:
> 
> Sorry I meant to ask about Oracle's ROWNUM statement.  Please change every reference
> of ROWID to ROWNUM.   With Oracle the first row returned from a dynamic select is ROWNUM
> number 1 and the 2nd row is ROWNUM  2.  Therefore the select statement can constrain the
> select by adding to the where clause something like "AND ROWNUM < 2".   Meaning only
> the first row is returned by the server to the client.
> 
> Dennis Lukefahr
> 
> >>> Jerome Abela <Jerome.Abela@stripped> 12/15/00 04:42AM >>>
> On Wed, Dec 13, 2000 at 01:40:55PM -0600, Dennis Lukefahr wrote:
> > I know MySQL has a LIMIT statement but the 3RD party tool only allows
> > us to CONSTRAIN the WHERE clause.  That is, we can tell the tool to
> > interject SQL code into the where portion of the select statement. It
> > appends that code to the where clause that the tool has already built.
> > The tool then generates the order by clause and then the tool
> > retrieves the data and returns it to the COBOL program.
> >
> > If I attempt to interject the LIMIT statement the limit clause is
> > added to the where clause instead of being placed at the end of the
> > order by clause.  So, I'm asking whether MySQL has anything similar to
> > the ROWID clause so that I can constrain the where clause.
> 
> Rows don't get an implicit rowid with mysql.
> 
> You can add a rowid column with the auto_increment option, and use it
> the way you would use ROWID. However:
> - I can't imagine a way to use this to simulate a LIMIT statement,
>   except for a full table scan.
> - rowid will not be reused.
> 
> Jerome.
> 
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread59135@stripped 
> 
> To unsubscribe, send a message to:
>     <mysql-unsubscribe-dlukefahr=stlouismusic.com@stripped>
> 
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
>     http://lists.mysql.com/php/unsubscribe.php 
> 
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread59150@stripped 
> 
> To unsubscribe, send a message to:
>     <mysql-unsubscribe-john=greengator.com@stripped>
> 
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
>     http://lists.mysql.com/php/unsubscribe.php

Thread
Question about ROWNUM. Anything similar in MySQLDennis Lukefahr13 Dec
Re: Question about ROWNUM. Anything similar in MySQLDennis Lukefahr15 Dec
  • Re[2]: Question about ROWNUM. Anything similar in MySQLDavid Tod Sigafoos15 Dec
  • Re: Question about ROWNUM. Anything similar in MySQLJohn Cichy15 Dec
  • Re: Question about ROWNUM. Anything similar in MySQLMilo Stefani15 Dec