tags:

views:

98

answers:

1

How to use the user defined variable in a way that the value of the variable is reused in the subsequent query in mysql?

+1  A: 

Just use it:

SELECT  @r := 1

---
  1

SELECT  @r := @r + 1

---
  2
Quassnoi