Re: Row Number Variable?
Sean Daniels Wrote:
-------------------------------------------------------
> Is there a built in function in MySQL for
> returning the current row number in a result set?
>
> i.e.: select id, func() as myrow from table
>
> id myrow
> ---- ----------
> 10 1
> 11 2
> 12 3
Hi,
try this
SELECT @rownum:=@rownum+1 rownum, mytable.*
FROM (SELECT @rownum:=0) r, mytable;
Subject
Written By
Posted
September 07, 2008 07:28PM
Re: Row Number Variable?
November 25, 2008 05:50AM
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.