From: Martin Gainty Date: October 4 2012 2:06pm Subject: RE: (real) silly question about variables... List-Archive: http://lists.mysql.com/mysql/228318 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_d74d2cf0-966b-49e0-9bc4-6b8100d4c800_" --_d74d2cf0-966b-49e0-9bc4-6b8100d4c800_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable in a mySQL statement the values are displayed BEFORE assignments are made Ciao=2C No MAS ______________________________________________=20 =09 =09 =09 Per favore non alterare o perturbare la comunicazione > From: urkapd@stripped > Subject: (real) silly question about variables... > Date: Thu=2C 4 Oct 2012 15:52:20 +0200 > To: mysql@stripped >=20 > Hi >=20 > I know there'd be a reason=2C but I can't understand that.. >=20 > mysql> select @valore:=3Drand()=2C @valore=2C @valore:=3D"ciao"=2C @valor= e=3B > +-------------------+-------------------+-----------------+---------+ > | @valore:=3Drand() | @valore | @valore:=3D"ciao" | @valore | > +-------------------+-------------------+-----------------+---------+ > | 0.483624490428366 | 0.483624490428366 | ciao | 0 | > +-------------------+-------------------+-----------------+---------+ > 1 row in set (0.00 sec) >=20 > mysql> select @valore:=3Drand()=2C @valore=2C @valore:=3D"ciao"=2C @valor= e=3B > +-------------------+-------------------+-----------------+---------+ > | @valore:=3Drand() | @valore | @valore:=3D"ciao" | @valore | > +-------------------+-------------------+-----------------+---------+ > | 0.747058809499311 | 0.747058809499311 | ciao | ciao | > +-------------------+-------------------+-----------------+---------+ > 1 row in set (0.00 sec) >=20 > why in the first execution the latest value is 0 and not 'ciao'? > and why in the first 2 columns the variables seems works as expected!? >=20 > thank you in advance >=20 > bye > MAS! >=20 >=20 > --=20 > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql >=20 = --_d74d2cf0-966b-49e0-9bc4-6b8100d4c800_--