Comments - User-Defined Variables

9 years, 9 months ago Federico Razzoli

In your case, I don't see any potential problems.

  • The subquery in which you initialize the variables should be constant.
  • The order of expressions passed to IF() is always the same.

I think that the statement you quoted refers to things like:

SELECT @a := field1, @b := @a + 1 FROM table;

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.