joe
joe

Reputation: 35117

MySql User Defined Variable

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

Upvotes: 0

Views: 357

Answers (1)

Quassnoi
Quassnoi

Reputation: 425823

Just use it:

SELECT  @r := 1

---
  1

SELECT  @r := @r + 1

---
  2

Upvotes: 1

Related Questions