List:General Discussion« Previous MessageNext Message »
From:Jeremy Cole Date:December 6 1999 4:41am
Subject:Re: AUTO_INCREAMENT in result
View as plain text  
Do that programmatically, in whatever language you are using...
create a variable, initialize it to 0 or 20, or whatever, and increment
it in the loop that is fetching the rows..

--Jeremy

Erik Andersson wrote:
> 
> Is it possible to add a counter field to the result which shows the actual
> row number? What I mean is something like this:
> 
> SELECT MYCOUNTERFUNCTION() AS No, field1 FROM table;
> 
> No    field1
> ------------
>  1    Frank
>  2    Eric
>  3    Urban
> 
> ...and even:
> 
> SELECT MYCOUNTERFUNCTION() AS No, field1 FROM table LIMIT 20, 3;
> No    field1
> ------------
> 20    Tony
> 21    Mitch
> 22    Max
> 
> I've checked the manual for hours, but no clue...
> 
> Best Regards! / Erik
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread20247@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
Thread
AUTO_INCREAMENT in resultErik Andersson4 Dec
  • Re: AUTO_INCREAMENT in resultSasha Pachev4 Dec
  • Re: AUTO_INCREAMENT in resultJeremy Cole6 Dec
  • is lock automatic?Andre Natal11 Dec
    • Re: is lock automatic?sinisa11 Dec
    • Re: is lock automatic?Paul DuBois11 Dec