ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles SCHLIENGER <gilles.schlien...@cncc.fr>
Subject RE : Using a user variable in a request with MySQL
Date Thu, 11 Jun 2009 14:43:22 GMT
Thanks Larry,

As far as I know, this is the standard workaround in MySQL to get the ROW_NUM of the resultset.

For example, this would return:
1,190
2,560
3,989

I actually need this to retrieve that number in a more complex query with joins

Thanks
Gilles

________________________________________
De : Larry Meadors [larry.meadors@gmail.com]
Date d'envoi : jeudi 11 juin 2009 15:58
À : user-java@ibatis.apache.org
Objet : Re: Using a user variable in a request with MySQL

On Thu, Jun 11, 2009 at 7:42 AM, Gilles
SCHLIENGER<gilles.schlienger@cncc.fr> wrote:
>
> SET @NUM=0;
> SELECT (@NUM:=@NUM+1), JET_ID FROM JETON
>    WHERE JET_FK_ABO_ID = 3;
>

Sorry, I'm not really up on mysql - what is this supposed to do?

Larry

Mime
View raw message