Reputation: 35117
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
Reputation: 425823
Just use it:
SELECT @r := 1 --- 1 SELECT @r := @r + 1 --- 2
Upvotes: 1